简体   繁体   中英

How to calculating and testing the number of concurrent connections?

Twisted server supports more than 10,000 concurrent connections. I want to write a test case to check it using Python.

What I know is just using multiprocessing + threading + greenlet. My question is how to confirm Twisted's support for more than 10,000 concurrent connections?

Something I know is using logger, but is logger accurate? Or has other way to calculate it?

It's easy to support more than 10,000 concurrent connections. What can be harder is supporting so many active connections. The kind of activity you expect to find on your connections is more likely to determine how many you can support at once. What do you expect these connections to be doing? Construct a test which reflects real world behavior and then see how many clients you can support with it. The more accurately your test reflects real world behavior, the more accurate your results will be.

Nicholas Piël's concurrency benchmarks are pretty interesting, and include comparisons of Twisted and other frameworks in Python. He also mentions how to test with socket handles numbering in the 10s of thousands.

Another good read on the subject is The C10K problem , although it doesn't just apply to Python.

By applying the techniques Nicholas uses you'll be able to verify his finds, and determine exactly what level of concurrency performance Twisted will achieve for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM