N
N
Nikelamoc2016-01-06 11:50:03
PHP
Nikelamoc, 2016-01-06 11:50:03

How would you architecturally make a php script that should work for a long time, eat decently operatives and at the same time not fall internal server error?

Good afternoon.
There is a php script, it works for a long time and eats a lot of RAM, the script is not cron.
So that on regular hostings it does not fall out in the internal server error , the script restarts itself through file_get_contents .
I understand that this is a crooked solution.
How would you architecturally make a php script that should work for a long time, eat decently operatives and at the same time not fall into the internal server error all the time?
Making the script a cron or raising the limits all the way is not an option.
Switch to python too.
I understand that somewhere on the internet this should be written, but a couple of days of googling gave out only old blogs and promo articles, if you share the link I will be very grateful.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
Alexander Litvinenko, 2016-01-06
@edli007

would not do it in php, a bunch of web languages ​​\u200b\u200bdesigned for long / continuous work.

R
romy4, 2016-01-06
@romy4

Make sure that resources are cleared (delete context, mysql_free_result, etc.) and variables. gc will do the trick. do not make circular references. otherwise, php is quite good and there are no such memory leaks as JS. here nodejs I would categorically not advise for long scripts.

O
OnYourLips, 2016-01-06
@OnYourLips

the script is not cron.
What does it mean?
Cron is not needed.
I would use the supervisor to control the workers, I would create several workers, and interact with them using queues.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question