5 ms·
Do C10K testing with gevent
- justincormack 16y agoHe doesn't seem to have tried Tsung which is a good solution for this scale of testing.
- lusis 16y agoI actually was pretty fond of this: https://github.com/newsapps/beeswithmachineguns https://github.com/newsapps/beeswithmachineguns I don't remember how I came across it but it's the same concept: fire up a swarm of EC2 instances to pound the shit out of your site.
- nivertech 16y ago1. I already solved C1M problem, so C10K and C100K looks like a non-problem to me. EDIT: metabrew has very good tutorial - which should be a starting point for everybody new to this space! 2. The problem is, that Amazon EC2 doesn't support multiple IP aliases per instance. To generate 1M connections, I had to launch a cluster of 17 instances to generate 1M clients. On physical server with a lot of RAM, you can just create 17 IP aliases. 3. Tsung is a great tool - but hard to control and has it's own limits. So if you need to do large scale loadtesting - better write your own tool.
- eugenejen 16y agoI have a stupid question here. When you have a large memory machine, why can't you serve 1M clients on 1 ip without IP aliases? I asked this question because if one uses 17 instances to handle 1M connections, for each instance is around 50k. I am more interested in knowing the possibility and performance for one machine to handle 1M connections.
- stonemetal 16y agoPort numbers are 2byte values. To track a connection as an IP:port number combination(the way your typical OS does it) you need multiple IPs to give you enough port numbers.
- nivertech 16y agoeach socket can be uniquely identified by 4-tuple: {LocalIP,LocalPort,ServerIP,ServerPort} LocalIP:LocalPort -> ServerIP,ServerPort So even if number of ports is limited by 64K, total number of incoming sockets per IP address isn't.
- nichol4s 16y agoYes, but when you are load testing a specific server, as in this case, you are bound to a specific serverIp and serverPort. And thus, the total amount of sockets you can have open to that server is limited by the amount of IP's your machine has.
- deleted 16y ago[deleted]
- stonemetal 16y agoIf we are testing a web server on port 80, such that ServerIP,and port are fixed, then the only way you are getting more than 64K connections is through multiple client IP addresses.
- wmf 16y agoIn the real world your 1M connections will be coming from ~1M clients, so there's no problem. When doing load testing with one client and one server you run into port number limits; this is most realistically solved by using multiple IP addresses on the client (or multiple clients if your cloud is crippled).
- nivertech 16y agothe real problem is not to generate 1M outgoing connections, but to handle 1M incoming connections on a single node (C1M), while in addition also doing some meaningful processing. It's a solved problem for me. That is why I don't understand why many high profile realtime web startups (like Convore), still using inferior solutions, like Python eventlib or gevent, which at most let them handle hundreds-to-thousands of clients. EDIT: metabrew has very good tutorial - which should be a starting point for everybody new to this space!
- eugenejen 16y agoAre you referring to http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-1 http://www.metabrew.com/article/a-million-user-comet-applica... http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-2 http://www.metabrew.com/article/a-million-user-comet-applica... http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-3 http://www.metabrew.com/article/a-million-user-comet-applica... By Richard Jones of the Last.fm? Thank you for your replying. The original C10k from Dan Kegel was a guideline for me when I worked on project during 2003 - 2006. I am wondering what is the latest progress in this area. I am glad this problem is solved to you. I will check out niver tech in future when the problem comes up.
- metabrew 16y agoC1M is the new C10K. C10K is not even close to being a real problem any more. I expect my phone can handle 10K connections. Making a million outbound connections, on the other hand, requires a little more care. Mostly because you need 16+ IPs. I ended up writing a small tool in C with libevent to make 1M http connections: http://www.metabrew.com/article/a-million-user-comet-application-with-mochiweb-part-3 http://www.metabrew.com/article/a-million-user-comet-applica...
- svlla 16y agoyou're only going to need 16+ IPs if you're making those outbound connections to the same destination IP & port... which seems unlikely.
- nivertech 16y agoYou can do TCP listen on 0.0.0.0:80 (any IP on port 80), but I never saw TCP listen on XXX.XXX.XXX.XXX:* (specific IP with any port) ;)