E
E
Evgeny Svirsky2016-08-23 21:44:21
symfony
Evgeny Svirsky, 2016-08-23 21:44:21

How to withstand the load?

Hello.
Big advertising of the portal is planned. 4 million users. The question is how to technically withstand such a huge load? I am sure that even excellent iron will not cope. Maybe someone had such an experience? Share plz.
Heard that it is possible to distribute requests. How can I distribute the request to 5-10 servers. What is the technology stack in this case?
The portal is written in symfony.
Thank you.

Answer the question

In order to leave comments, you need to log in

7 answer(s)
B
Bowen, 2016-08-23
@e_svirsky

Take a look here , it might help you.

S
sim3x, 2016-08-23
@sim3x

4kk / (60*60*24) = 46 rps
hiload
lol
nginx ( + lua scripts) or nginx plus
set up upstream for 1-2 servers
on php-fpm servers
If the load is read only, 1 server with a good channel can handle it
Update-insert require DBMS setup
Or hire a person who understands what needs to be done

I
Igor Vorotnev, 2016-08-23
@HeadOnFire

4 million at the same time?
4 million a day?
4 million per month?
4 million for 1 view?
4 million per 1000 page views, including pages with high CPU/memory/disk load?
4 million with 95% of queries in the database for reading?
4 million with 50% write requests to the database?
...
Do you understand where I'm getting at?
In general, what you are asking is called load balancing, or a load balancer. Google, learn the basics and principles of this architecture. When you get comfortable in the topic, you yourself will understand what to do. There will be more precise questions along the way - you are welcome.
If there is no time for all this, hire a specialist who will ask you a lot of questions and build a suitable solution based on the same AWS.
PS: 4 million uniques if you count "per month" is not a huge number. A lot, yes. But far from huge and serviced quite easily.
UPDATE: +1 to Bowen 's ruhighload.com link

X
xmoonlight, 2016-08-23
@xmoonlight

1. The load is small. (where 4 million users come from - it is not yet clear, if the mailing list - 10-15% (~ 400k) will come, of which 10-15% (~ 40k) will also register, etc.)
2. On the front - it would be better if it was SPA.
3. For requests to the database - it would be better to make parallel independent requests to the database in batch mode (an analogue of trains and waiting passengers on the platform)
Bottom line: if everything is done correctly, a smartphone can handle it.

S
Slava Vitrenko, 2016-08-25
@bagiroff777

Test on a virtual machine how many requests per second your application holds.
The first is incl. php-opcache, switch to php7, enable ccaching.
Next:
$ yum install -y httpd-tools
$ ab -n 1000 -c 100 https://your_site/heavy page/
With the result, we come to the toaster and ask the question again.

A
Andrey Shatokhin, 2016-08-23
@Sovigod

Practice shows that it is best to cache pages on nginx. Approximately so . And place the cache directory (proxy_cache_path) on tmpfs.
Then all guests will receive super fast responses from the server, which will not give you any load.

E
Evgeny Svirsky, 2016-08-26
@e_svirsky

Thank you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question