Long requests block other requests in Apache and PHP

I have a request that takes about 1.5 minutes, but when it executes the request, it blocks all other server requests. I am using Apache with mod_php. What is the best way to fix this? Thank!

+5
source share
2 answers

<sub> [mod_telepathy] sub>

Do you use sessions? If so, until you close the session in a long script, others will wait for it.

If you don’t need a session there all the time, you can close it with session_write_close()

<sub> [/ mod_telepathy] sub>

+13
source

File sessions will cause a lock. If you are using a database or memcache / redis, you can prevent this lock.

+1

All Articles