T
T
tincap2016-02-25 17:14:11
MySQL
tincap, 2016-02-25 17:14:11

Does the server hang when there are a lot of requests?

Powerful server.
Apache, PHP, MySQL.
The project is written in Yii2. There is a file that works with the database. Let's call it api.php
So, I want to access it up to 1000 times per second. But the server freezes and stops responding. How do the API systems of other services work? They are accessed up to 100500 times per second.
PS CPU is loaded by 16%, RAM by 15%
I think it's a hard drive. SSD disk.
7fde3b607abd41cbb8f8ebce2088d127.png

Answer the question

In order to leave comments, you need to log in

4 answer(s)
W
werw, 2016-02-25
@werw

Well, about 100500, you've had enough. Such scales are realized by other brains.
But, for example, my servers can withstand 10,000 per second, and even with a margin, as tests show.
There is nothing smart inside.
First, take measurements and find the bottleneck.
As practice shows, it is not necessary to rewrite everything, it is enough to overcome 2-3 of the bottlenecks.
Your problem statement itself is wrong: "the server freezes and stops ...."
Well, put entries in the log, analyze.
Take special measurements, look for a bottleneck.
It's not about MySQL, Apache, Yii - they make a less serious contribution to the brakes.
The point is primarily in your code - and who knows it except you.
Maybe you just made a typical stupid cant of a novice programmer:
https://habrahabr.ru/post/113298/

A
AntonMZ, 2016-02-25
@AntonMZ

Does the server freeze when accessing this file? Have you watched the server load at the time of accessing the file? What is growing?, apache/mysql/php... little input. Maybe you have a crooked mysql query or a bunch of slow queries, maybe there is not enough memory, maybe a processor ... What is a "Powerful Server"? in your understanding?

S
shuraosipov, 2016-02-25
@shuraosipov

Try putting nginx before apache.
Here you will find performance comparison for nginx and apache - wiki.dreamhost.com/Web_Server_Performance_Comparison

A
Anton Ulanov, 2016-02-25
@antonsr98

But how to find such bottlenecks?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question