0

I have a very simple Bottle app which has just one function. It is mainly I/O bound, however some processing takes place. My app instances don't have to communicate with each other.

I run it on a 8-core machine and want to optimize TPS.

If I follow the Bottle with Paste example. only 1 CPU will be used.

bottle.run(server='paste')

If I use Gunicorn with 8 processes, I won't have the advantage of threads.

bottle.run(server='gunicorn', workers=8)

In https://stackoverflow.com/a/20985164/604515 it is suggested to use Tornado with the start option. However, I cannot get Tornado to fork when I launch it like this, as a ps uxaf will only show one process.

bottle.run(server='tornado', start=8)

So, how do I configure Bottle for maximum TPS on a SMP machine?

Community
  • 1
  • 1
Willem
  • 3,043
  • 2
  • 25
  • 37
  • 1
    If it's mainly I/O-bound, why do you think using 8 cores will make it faster? Does it ever approach 100% CPU? – abarnert Apr 16 '15 at 09:30
  • Also, what does "I won't have the advantage of threads" mean? What advantage? What do you _need_ threads for? (If you're worried about the higher startup cost of processes vs. threads on Windows or another platform, don't worry about that; the workers aren't stopped and started nearly often enough to make even the tiniest measurable impact on your CPS.) – abarnert Apr 16 '15 at 09:31
  • Have you considered gevent? http://bottle.readthedocs.org/en/latest/async.html#greenlets-to-the-rescue – ron rothman Apr 16 '15 at 19:26

0 Answers0