[Verse-dev] socket buffer size on os x

Eskil Steenberg eskil at obsession.se
Thu Mar 24 20:21:11 CET 2005


Hi

> v_network: Couldn't set send buffer size of socket to 1048576
> v_network: Couldn't set receive buffer size of socket to 1048576
>
> Seems the buffer sizes are now being set, since a commit 2 weeks ago. But
> on os x, I can only set values up to (1 << 17). That's 128KB instead of
> the
> requested 1MB being requested now.

Yeah thats my change. The in comming and out going buffer size has a lot
to do with performance. If you don't enpty the incoming que often enough
data gets trown away, and since a user can take time between any verse
calls there there is no way for verse to empty this buffer as regularly as
one like (and there is the issiue of slow task switching in operatings
systems that are not optimized for low latency). So the fix is to make
this buffer larger. runing localy on the win32 platform this has a huge
impact (it split the sending time of a large bitmap to a fifth of the
time, althoug that can be debatable since the bottle neck moves to other
areas of the code). So i just set that value to something high and i got a
big performance jump. To be honest i never relay explored how high is high
enough, and that may even be tricky, even if a lower value would work fine
for my tests it may still break some one elses app, it that app sends more
data (because it packs faster then my machine) or it emptys the buffer les
often then my application.

So there is no real good way of detemaning this. I just assumed that 2
megabytes of ram was something that most people easely could sacrefice to
get good perfomance.

My only suggestion is to take it down to something like 128k and see if we
get a performnce problem. This means that if some one sends data at
arateom 100Mbit you need to empty the buffre roughly 100 times a second,
and i think linux only task switches 100 times a second so that might be a
problem (i dont dare to think about win32...)

Any other suggestions?

E



More information about the Verse-dev mailing list