如何测试连接到php api的x个客户端数量

I just build an api for a software I'm developing, now my question is: How can I test my api for, for example, 500 clients connecting at the same time. I need to make sure that I have coded for the fastest and clean as posible.

edit: The php apí is : cakephp with a cron job requesting info from another api called globalsportsmedia

the app is: Ios app the connects to the php api.

the test i need to do it: simulate 5000 people requesting game stast each minute.

For parameterized tests I usually turn to Apache JMeter. It takes a bit of time to set it up, but it will give you great flexibility for stress-testing any kind of service.

Refering to your specific needs, you can

  • set up any number of users
  • feed API keys to your requests from an external file
  • define idle times between requests for users via timers
  • randomize timers to have a more lifelike load on your service
  • extract variables from responses via regular expressions
  • use extracted variables in subsequent requests
  • set it up for distributed testing with coordinated requests from several clients

All in all, it's a pretty awesome tool.