HTTP request limit and SQL queries

Asked

Viewed 904 times

0

I am developing a system that will have a large amount of requests and would like to know the opinion based on your experience.

1) A server running apache with php and 64GB of memory, would it process 50,000 requests per second? Example, an HTTP request for GET returned a 'Hello world in text'.

2) This same request would do an UPDATE on a server running only Mysql, Mysql would support 50,000 queries per second?

My doubt is very general, I hope you have provided enough information for an opinion. Or else, what configuration would be required to support 50k requests or more?

  • Processing 50K simultaneously in Mariadb in a single instance and on a server shared with PHP is literally impossible. A unique Mariadb-only server with 64GB RAM and a reasonable CPU (2x E5-2620) can support 1000~5000 simultaneous requests, so it will depend on how long each takes, but it depends on the complexity of the query and what it can use, for example from read_buffer_size, sort_buffer_size, join_buffer_size, read_rnd_buffer_size... Apart from CPU usage and read/write rate on disk.... If you have 50K concurrent only with multiple replicates.

1 answer

2

Well, come on!

Memory, processor or disk is not everything

When it comes to infrastructure, having a strong processor, a disk drive with high I/O or up to 64gb of memory may not support large requests per second. You need to analyze everything for scale.

Database

Mysql may not be the most recommended for you, you can opt for Nosql banks, which will improve your performance much more. It is also interesting to study cluster that divides the loads, working with several nodes.

Study implementation for example of Redis, Elasticsearch, MongoDB etc. Each engine has a proposal that works best with specific issues, study your case.

PHP

I am developing PHP, but put in check-mate with a question: PHP is the best language for this purpose of large requests? Have you studied other approaches? What is the goal? What is the expected outcome?

Escale and not-Shared

First, you need to understand what it is load balancer and how it can help you with the high-scale servers you’ll need to provision.

Your infrastructure should be all interdependent and have fault planning.

Finally

Your question is too little generic, since asking if x or y language can handle x or y requests for seconds over x or y conditions is too big, it’s not that simple infrastructure. Nowadays there are several technologies that can abstract greater responsibility with lower costs, for example Docker. If you have in your hands the development of a system that will receive this load, the interesting thing is to look for people responsible for their respective areas such as: Database, Infrastructure and project manager. Many details will be taken into account, so only then can you build a scalable, inexpensive and above all, strong infrastructure :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.