jonhoo / volley

Volley is a benchmarking tool for measuring the performance of server networking stacks.
MIT License
123 stars 12 forks source link

Increase the number of system threads in golang #16

Closed diegobernardes closed 9 years ago

diegobernardes commented 9 years ago

Now go-blocking has a new flag that receives the number of connections to create one system thread for each connection.

jonhoo commented 9 years ago

Hmm, no, I don't think I want to accept this. It is effectively cheating -- servers generally do not know how many clients there might be.

diegobernardes commented 9 years ago

Ok, no problem, but the golang test gonna always perform worse than c and rust because we running with less threads.

jonhoo commented 9 years ago

If there was a way of doing this without passing in the number of clients, I'd be fine with it. Like incrementing GOMAXPROCS for every new client or something. I'm not sure that'd be a good idea though :confused:

methane commented 9 years ago

How about runtime.GOMAXPROCS(runtime.NumCPU() * 4)?

jonhoo commented 9 years ago

It didn't matter much for the idiomatic Go implementation (#2), but I can run some benchmarks on go-blocking with a higher GOMAXPROCS to verify. Do you think LockOSThread is still necessary?

methane commented 9 years ago

I don't know how much LockOSThread increase (or decrease) performance.

methane commented 9 years ago

I'll update go-blocking with "dedicated thread for each connection" model.

methane commented 9 years ago

@diegobernardes Could you review #24 ?

diegobernardes commented 9 years ago

@methane me review your code? who am i to do this, you that need to review my code.. :sweat_smile:

LockOSThreaddidn't show any increase/decrease of performance on my notebook, and i don't have a 80 core machine to do the benchmark.

About the increase/decrease of GOMAXPROCS during runtime, i don't know if this can decrease performance. Reading the method source code show calls to starttheworld and stoptheworld. Didn't found the declaration in go1.4, i think that this is done in c, but in tip is in golang

I dont have much time now to do deep analysis, but im afraid that we gonna have a extra overhead in this calls.

@jonhoo i don't know if you have time to do this or patience, but you could run the tests with the PR @methane submited and then we can do other rounds of tests without LockOSThread and dynamic GOMAXPROCS(could set the gomaxprocs to always be 200, the max number of clients connected).

jonhoo commented 9 years ago

Continued in #24.