slow response in web access.

Current Development version likely to have breaking changes
Post Reply
pepex7
Posts: 44
Joined: Wed Feb 08, 2023 11:55 pm

slow response in web access.

Post by pepex7 »

In zm 1.37.65, I have a delay in responding via web.
When I reset the apache2 (service sudo systemctl restart apache2), I can access it a little faster again.
Any recommendations?

tail -f /var/log/apache2/error.log

Code: Select all

[Fri Dec 20 09:25:14.419544 2024] [php:warn] [pid 609185] [client 192.168.140.15:43044] PHP Warning:  sem_get(): Failed for key 0x55a0f: No space left on device in /usr/share/zoneminder/www/ajax/stream.php on line 18
[Fri Dec 20 09:25:14.419544 2024] [php:warn] [pid 556102] [client 192.168.140.15:60584] PHP Warning:  sem_get(): Failed for key 0x3db87: No space left on device in /usr/share/zoneminder/www/ajax/stream.php on line 18
[Fri Dec 20 09:25:14.728959 2024] [php:warn] [pid 779144] [client 192.168.140.14:48066] PHP Warning:  sem_get(): Failed for key 0x38cac: No space left on device in /usr/share/zoneminder/www/ajax/stream.php on line 18
[Fri Dec 20 09:25:14.956552 2024] [php:warn] [pid 779144] [client 192.168.140.14:48066] PHP Warning:  sem_get(): Failed for key 0x48e19: No space left on device in /usr/share/zoneminder/www/ajax/stream.php on line 18
[Fri Dec 20 09:25:15.344165 2024] [php:warn] [pid 488823] [client 192.168.140.15:59850] PHP Warning:  sem_get(): Failed for key 0x55a0f: No space left on device in /usr/share/zoneminder/www/ajax/stream.php on line 18
[Fri Dec 20 09:25:22.574294 2024] [php:warn] [pid 653155] [client 192.168.140.15:44488] PHP Warning:  sem_get(): Failed for key 0x4aa2f: No space left on device in /usr/share/zoneminder/www/ajax/stream.php on line 18
User avatar
borozenetsww
Posts: 47
Joined: Tue Sep 12, 2023 1:55 am

Re: slow response in web access.

Post by borozenetsww »

Code: Select all

No space left on device
is key phrase i think
User avatar
iconnor
Posts: 3263
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: slow response in web access.

Post by iconnor »

For reference, there were two issues here. pepex7 is using zmninja for viewing and zmninja really hits zm a lot, causing zm to use up all semaphores. So we put in place a cron job to clean out semaphores. The second issue is that apache defaults to only doing 150 workers which was not adequate. Apache needed to be tuned to allow way more.
pepex7
Posts: 44
Joined: Wed Feb 08, 2023 11:55 pm

Re: slow response in web access.

Post by pepex7 »

Thank you @iconnor
I'm not sure if this is a good configuration, but it has worked for me (so far).
I've been looking for some guide or recommendation for configuring Apache for zoneminder, but I couldn't find any.

I followed this guide.
https://www.hostmycode.in/tutorials/opt ... c-websites

sudo nano /etc/apache2/apache2.conf

Code: Select all

KeepAlive On
MaxKeepAliveRequests 1000
KeepAliveTimeout 5
sudo nano /etc/apache2/mods-available/mpm_prefork.conf

Code: Select all

<IfModule mpm_prefork_module>
        StartServers            5
        MinSpareServers         25
        MaxSpareServers         75
        ServerLimit             1000
        MaxRequestWorkers       900
        MaxConnectionsPerChild  1000
</IfModule>
I'm still reviewing this, I'd like to get to the best.
Post Reply