T
T
Titogu2016-10-15 23:44:21
MySQL
Titogu, 2016-10-15 23:44:21

What problems can there be with iron during expansion?

I am developing a site that will work with other sites through the API.
PHP 7, YII2, NGINX, GEARMAN tools.
Users create specific jobs that are submitted to a queue.
Then a worker is launched into the background using php exec () which picks up this task and starts processing it.
Tasks can be different, the execution time is from several minutes to 5-10 hours - several requests for the API, then a slip for 20-30 seconds and so on in a circle.
I am now interested in the issue with connections to the database from the workers. What happens if several hundred workers are launched at the same time and several hundred people are on the site?
1. Will MySQL survive?
2. How to roughly calculate what server parameters are needed?
3. Will there be one connection to the database for each worker?
4. What other problems can there be?
I will add that ~ 3 queries to the database will be executed in the worker, 1 - for update, 1 - for insert and 1 - select.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
latteo, 2016-10-18
@latteo

Run the maximum possible number of workers on the developer's computer and see the load.
If there is a suspicion that the site will also consume a lot, run ab / siege in parallel.
Roughly estimate the difference with the server and it will be clear what's what.
Take a test VPS from the host, if possible, and check it out.
This is the only adequate assessment.
PS: I had workers that slowed down core i3 + ssd in 20 threads, until it was completely impossible to work on this machine. And there were those who did not care about 100 threads - the load is almost invisible.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question