S
S
Shillkas112018-12-30 14:49:07
PHP
Shillkas11, 2018-12-30 14:49:07

Apache how to implement simultaneous operation of several scripts?

Hello. There is a script which processes some data from a DB, and by a condition copies this data to other records in a DB. It is launched through the browser at the site.com/admin/copy_data_from_db link, its execution time is about 24 hours.
But now, when it starts, the server stops responding to other user requests, returns a 504 Gateway Time-out error.
It is necessary to make both this heavy script and other user requests work at the same time, even with some delay in processing speed. Those. make sure that several scripts run in parallel. As far as I know, Apache has the ability to execute multiple scripts at the same time, but why is the server not responding to other requests when this script is run now?
PS Run this script through the console as I understand it will not work, because. it is tied to symfony, and only single scripts can be run through the console.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
index0h, 2018-12-30
@Shillkas11

> only single scripts can be run through the console
Read the documentation and don't invent nonsense. > It is
launched through the browser at the site.com/admin/copy_data_from_db link.
to put nafig your site you need to follow the link ...
> Apache how to implement simultaneous operation of several scripts?
Apache has nothing to do with it with all its might. Read about mysql explain and optimize queries.
If there is nowhere to optimize, break the processing into small parts, for example, 500 lines per iteration. Pay attention to isolation levels.

R
Rsa97, 2018-12-30
@Rsa97

You need to see what this script does. It is possible that it locks the tables, and the rest of the scripts cannot wait for them to be released.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question