I
I
Islamfon2015-10-01 18:30:47
PHP
Islamfon, 2015-10-01 18:30:47

How to increase the performance of php on the server?

There is a php file request handler from the Telegram BOT API.
With multiple requests to the bot, the php handler stops processing any requests.
I solved the problem like this, for each request I open a background process

exec('bash -c "exec nohup setsid php ./script.php > /dev/null 2>&1 &"');

Everything was fine, but still very rarely at rush hour, the php handler starts to fall dead. Only Reboot Apache2 and mysql helps.
I heard that the most miserable values ​​​​of php workers are set in the server settings.
What to do? How to increase the power of php?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
Tlito, 2015-10-01
@tlito

try writing in C++ to compile and call it script.cgi and not load the server with unnecessary processes.
let the finished program work and not your script code

E
EvgeniyKonstantinov, 2015-10-01
@EvgeniyKonstantinov

Since you are doing tasks in the background, it makes sense to do it idiomatically.
For PHP via Gearman: gearman.org
PS:
PHP provides a huge field for its optimization on an epic scale. Therefore, I will not try to describe even just the directions in this field.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question