multiple WebClient
multiple WebClient
multiple WebClient
multiple WebClient
multiple WebClient
multiple WebClient multiple WebClient multiple WebClient multiple WebClient multiple WebClient multiple WebClient multiple WebClient multiple WebClient
multiple WebClient multiple WebClient
multiple WebClient
Go Back  Xtreme Visual Basic Talk > > > multiple WebClient


Reply
 
Thread Tools Display Modes
  #1  
Old 03-10-2017, 02:20 PM
Roger-U Roger-U is offline
Centurion
 
Join Date: Apr 2008
Location: Surrey, UK
Posts: 112
Default multiple WebClient


I have a program in VB.net 2008 that manages about 6 websites.

So I wrote a little routine to poll them all and measure the response times - typically around 40mS

The polling routine runs in its own thread.

Then I thought "ok, fire off 6 threads and poll them all" .. well it works but the response time is now around 500mS

I experimented with different values for
ServicePointManager.DefaultConnectionLimit and ServicePointManager.MaxServicePoints

but that makes no difference.

Surely I should be able to fire off any reasonable number of webClient requests each on its own thread without that sort of time penalty.

any ideas what I am missing?
Reply With Quote
  #2  
Old 03-10-2017, 10:29 PM
Cerian Knight's Avatar
Cerian Knightmultiple WebClient Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,199
Default

Probably not much help.

I assume each of the 6 threads is not polling all 6, but 1 each (you didn't say that you re-wrote the routine to poll less than 'them all')?

It might be interesting to know if the first one polled is always the first one to respond, 2nd is 2nd, etc?

Motherboard network interface or secondary (add-in) network interface?
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
  #3  
Old 03-11-2017, 01:37 AM
Roger-U Roger-U is offline
Centurion
 
Join Date: Apr 2008
Location: Surrey, UK
Posts: 112
Default

correct, each thread only polls one site

I can't see any logic to the order they respond.. I suspect it just depends the site's response time (and whether it was asleep!).

But it is certainly not the case the my PC is simply queuing the outgoing messages until each has responded.

I don't have any non-standard hardware.. It's a Dell Inspiron.. admittedly still running Windows 7 profrssional
Reply With Quote
  #4  
Old 03-11-2017, 05:04 AM
Roger-U Roger-U is offline
Centurion
 
Join Date: Apr 2008
Location: Surrey, UK
Posts: 112
Default

oh dear ... it was me all along .. well isn't that usually the case

in the process of trying this out I was too lazy about making the program wait ... to many doEvents were simply hogging the processor

but I did meanwhile discover that WebClient is twice as fast as HttpWebRequest
Reply With Quote
  #5  
Old 03-13-2017, 05:38 PM
Cerian Knight's Avatar
Cerian Knightmultiple WebClient Cerian Knight is offline
Polymath (in disciplina)

Super Moderator
* Expert *
 
Join Date: May 2004
Location: Michigan
Posts: 4,199
Default

Quote:
Originally Posted by Roger-U View Post
... to many doEvents were simply hogging the processor
Oddly enough (face-palm), I had that same issue very recently with form responsiveness during writing a 2GB file. Initially I tried increasing the DoEvents frequency... which made the issue even worse.

Falling back to the old rule-of-thumb... more than ~20/second is (usually) unnecessary, and in some cases, detrimental: the form became more responsive and the simultaneous I/O operation completed more quickly.
__________________
I got all the answers wrong on the GLAT, apparently even #9 (where I put a period in the middle of the box and labeled it 'singularity ripe for rapid inflation').
Reply With Quote
Reply

Tags
webclient, poll, fire, response, thread, routine, time, difference, surely, values, makes, penalty, sort, missing, ideas, reasonable, experimented, requests, wrote, measure, times, websites, program, vb.net, manages


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
multiple WebClient
multiple WebClient
multiple WebClient multiple WebClient
multiple WebClient
multiple WebClient
multiple WebClient multiple WebClient multiple WebClient multiple WebClient multiple WebClient multiple WebClient multiple WebClient
multiple WebClient
multiple WebClient
 
multiple WebClient
multiple WebClient
 
-->