The realtime service is a hybrid of CPU intensive tasks + lots of network IO. Gevent was handling the network IO without an issue, but at higher contention, the CPU was choking everything. Switching over to Go removed that contention, which was the primary issue that was being seen.
(pypy)➜ test time python test_py.py python test_py.py 11.32s user 0.56s system 99% cpu 11.912 total (pypy)➜ test time ./test2 ./test2 2.36s user 1.79s system 99% cpu 4.148 total
jjx
2014-05-08 20:03:51 +08:00
python 2.7同pypy差别同一差不多, 相差3~4秒
(python)➜ test time python test_py.py python test_py.py 15.09s user 0.77s system 99% cpu 15.893 total