signalbox icon indicating copy to clipboard operation
signalbox copied to clipboard

Multitread Support

Open cdgraff opened this issue 9 years ago • 7 comments

Hi, today I running signalbox ([email protected] branch) with a good amount of concurrent users, but my doubt is about multitread support, why into TOP I see the CPU used al 100% and never grow more than this...

Video here: https://www.dropbox.com/s/307qg3lek73ip4t/htop-signalbox.mp4?dl=0

Thanks for any advice!

cdgraff avatar Jun 17 '15 02:06 cdgraff

You need to set the environment variable GOMAXPROCS. Go will only use one CPU/Core by default unless you set GOMAXPROCS. See http://golang.org/doc/faq#Why_no_multi_CPU for more details.

cfreeman avatar Jun 17 '15 23:06 cfreeman

How did GOMAXPROCS go? Can I close this one off?

cfreeman avatar Jun 21 '15 03:06 cfreeman

yes after setup GOMAXPROCS cpu use was shared with the 4 process that I setup.

About perf of this actions, just with a few users i see that use 100% off all CPUs like can see into the image: captura de pantalla 2015-06-21 18 45 46 Thanks!

cdgraff avatar Jun 21 '15 22:06 cdgraff

Well that certainly shouldn't be the case. Does it slowly ramp up, or does it reach a point where it suddenly blasts your CPUs? Can you dig through the logs and let me know how many people are connected and how many rooms you have?

cfreeman avatar Jun 22 '15 04:06 cfreeman

Hi, the rump up, is quick just when we enabled and start to send traffic to the tracker increase in seconds to reach high CPU use.

The max numbers of users into a room was: 2015/06/23 01:43:41 INFO - Writing /roominfo|{"memberCount":454} to 0xc2099c7d10

But i see many lines equal except by the ID, look like something be wrong. Here 10 min full log https://www.dropbox.com/s/66d850bal6c5sat/signalbox.log.2.tar.gz?dl=1

I think you will understand better what check into the logs...

thanks!

cdgraff avatar Jun 23 '15 02:06 cdgraff

Sorry. I'm logging everything at the moment. I have toned things down a little in your branch and evaluating leveled logging libraries for go. This one here -- https://github.com/golang/glog -- is looking like the winner at this stage. I also need to write some load tests. Lemme know if the turning down logging improves things much.

cfreeman avatar Jun 23 '15 06:06 cfreeman

Hi, after this changes, the CPU use is much lower, but I see 1 process using 100% of 1 core... and the other process just less than 5% average... something still happen with this tread... and when this reach 100% can't accept more users, websocket deny new connection by timeout.

Logs of this can downloaded here: https://www.dropbox.com/s/l1hngfylqzdy08x/signalbox.log.2?dl=1

Let me know if need any new test Thanks! Ale

cdgraff avatar Jun 23 '15 22:06 cdgraff