I use http package for my production Web application (raw http
package, without web.go or other wrapper). I am very happy with my new
Go implementation of this application. My experience shows that Go (on
Linux) is definitely ready for production use, certainly not less than
CPython which I use a lot.
I use 8g for compilation and I run my application like this:
GOMAXPROCS=2 nohup komunikaty $PARAMS </dev/null >$LOG 2>&1 &
A few days later I run ps -eL and I get:
PID LWP TTY TIME CMD
10189 10189 ? 00:00:11 komunikaty
10189 10190 ? 00:00:00 komunikaty
10189 10191 ? 00:00:00 komunikaty
10189 13747 ? 00:00:03 komunikaty
10189 15398 ? 00:00:01 komunikaty
10189 15400 ? 00:00:00 komunikaty
10189 29227 ? 00:00:03 komunikaty
10189 29793 ? 00:00:00 komunikaty
10189 29794 ? 00:00:02 komunikaty
10189 2426 ? 00:00:03 komunikaty
10189 2434 ? 00:00:00 komunikaty
10189 2460 ? 00:00:01 komunikaty
10189 23877 ? 00:00:04 komunikaty
10189 23880 ? 00:00:00 komunikaty
10189 26207 ? 00:00:01 komunikaty
10189 26208 ? 00:00:03 komunikaty
10189 26209 ? 00:00:00 komunikaty
10189 31882 ? 00:00:00 komunikaty
10189 31883 ? 00:00:02 komunikaty
10189 8119 ? 00:00:00 komunikaty
10189 8124 ? 00:00:00 komunikaty
10189 8127 ? 00:00:00 komunikaty
10189 8605 ? 00:00:00 komunikaty
10189 8607 ? 00:00:04 komunikaty
10189 8625 ? 00:00:00 komunikaty
10189 9027 ? 00:00:01 komunikaty
10189 9028 ? 00:00:00 komunikaty
10189 9029 ? 00:00:00 komunikaty
10189 9030 ? 00:00:00 komunikaty
10189 9031 ? 00:00:00 komunikaty
10189 9040 ? 00:00:05 komunikaty
10189 14426 ? 00:00:04 komunikaty
10189 14427 ? 00:00:00 komunikaty
10189 14428 ? 00:00:02 komunikaty
10189 14429 ? 00:00:00 komunikaty
10189 14430 ? 00:00:00 komunikaty
There are 36 threads. But I specify GOMAXPROCS=2. I don't use
gorutines explicitly in my code but the http and net packages uses
them a lot.
Isn't GOMAXPROCS a thread limit but only limit of threads working
simultaneously?
I know that internal scheduler (in 6g/8g implementation) schedules
gorutines on limited number of system specific threads for performance
reasons and to conserve system resources. So, how many gorutines had
to work at the same time to create 36 system threads on Linux?
--
Michał Derkacz
https://github.com/ziutek