Support ⇒ Requests :: Archives ⇒ Server Load Check :: Archived ⇒ Community Forums ⇒ CPG Dragonfly™ CMS
Forum IndexRequests

Archived ⇒ Server Load Check


The Server Load are huge problem in each CMS during HIGH Traffic can caused server spike so HIGH then its be causing a problem to your site.

I been wondering that DF can check Server Load by on/off switch configuration. If it on, its should be checking server load, When it get too HIGH, DF will calling cpg_error function like to said Sever is too Busy? Some time, this can be more useful.

Firefox is my Favorite Browser

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS


This is certainly a problem that we've experienced and discussed in a couple of threads (here and here). The only way we've found round them is just to buy bigger servers .... not ideal but effective!

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/2.2.4/5.0.37/5.2/9.1.2.1


BadCO wrote
This is certainly a problem that we've experienced and discussed in a couple of threads (here and here). The only way we've found round them is just to buy bigger servers .... not ideal but effective!


Buy Bigger service is less effective then its introduce new problems too.

Firefox is my Favorite Browser

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS


Maybe, but we've found that Dragonfly works extremely well on a two server platform (1 x apache server, 1 x MySQL server). Before this our site used to max out with 4-500 people online and loads >20. This is no longer a problem and we routinely register 250-300k page hits/day.

We tried on this site to gain an understanding of how we could make our existing servers work better but were unable to do so. To be honest I suspect that this is territory that relatively few sites enter and therefore no-one really knows how well DF scales....

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Linux/2.2.4/5.0.37/5.2/9.1.2.1


Indeed, server load checking is very unpredictable.
Some factors do show when a server slows down:

- mysql on dual core
- mysql locking

Yes indeed, MySQL is not your ideal platform when you have multiple cpu's/cores.
If you have such system it is highly advisable to use PostgreSQL >= 8.1.4 because that one has received a speed increase of around 240% compared to MySQL on similar systems.

This is also one of the major considerations why we all put a load of time and effort into making Dragonfly compatible for it.

MySQL lock ups mostly are caused by UPDATE statements that include a malicious WHERE part to find data in varchar fields on a large table.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


I'm not sure if you are actually having trouble or are just putting forward an idea. Also I don't know your level of knowledge to excuse me if this post is irrelevant or insulting.

I looked into this various times and have read a lot of help forums. I won't try and cover that all here, but here are my most important conclusions. I'll add to them when I have more time. Sorry few links as I'm short of time to dig them out.

Do not let your server use swap space on the disk - this is where you will get the spike you were talking about. On our server processor load would build relative slowly to a server load of 5 then start accelerating. Once at about 10 it would be seconds before 20 etc.

As soon as your server starts writing to the disk you enter a vicious circle and it will get slower and slower until it stops dead. Threads queue up for resources, server needs to access the HD so responds slower, so queue grows larger and repeat

Solve this with the mysql config file my.cnf and apache httpd.conf as described in the first half of this and reading the tuning pages of the official mysql online help:

www.onlamp.com/pub/a/o...uning.html

As well as improving performance, you want to cap the number of connections. This will stop the spiral and no additional CMS error should be needed. You will just get the connection one.

Read the "top" manual and watch top at busy times. This will give you a very good idea of how much memory your different processes are using as top gives a % readout for each process (% or total RAM available). It also shows you if you are using swap space.

Use eaccelerator to improve php performance. This made a very big difference to our apache server.

As I said let me know if you want more and I'll dig back through my notes, but these three were the really big ones.

Olive Net
British Army
Royal Navy
Military Clothing and Equipment - This Tribe

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Slackware 12 / CentOS, PHP 5.6, MySQL 5, Apache 2


Just had another think about this and I reckon it's quite a good idea to have some sort of user early warning or load graph rather than just the error message. Perhaps a red warning could be triggered in the header.

This could be relatively simply done by executing "cat /proc/loadavg" and an "if" statement in php. "The site is getting really busy and we're having problems keeping up. It may be worth coming back later" ?

Or is that pointless clutter? Better to spend time getting the server performance right probably.

Olive Net
British Army
Royal Navy
Military Clothing and Equipment - This Tribe

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Slackware 12 / CentOS, PHP 5.6, MySQL 5, Apache 2


Problem is that many shared hosting disallow access to functions like system(), exec(), etc. that call server commands to get the server load.

Since shared hosters have the biggest issue there is no real advancement to include it into Dragonfly.

However, maybe index.php would be best to allow preloading a check file "if" such file exists.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Fedora 25 / Apache 2.4.27 / MariaDB 10.1.26 / PHP 7.1.10 / Mercurial


if (is_readable('/proc/loadavg') && $load = file('/proc/loadavg')) { might works?

Firefox is my Favorite Browser

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Apache/1.3.34 (Unix)/4.0.25-standard/4.4.1/CVS


mpwebwizard.com/free_s...ad_monitor

Adapt as you wish Smile

I just use it to monitor, but personally, incorporating a mirror option is better than blocking access to your site. If you do that, you need to consider ramifications with search engines.

Furthermore, it might be foolhardy to trigger any action based on instantaneous spikes.

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Ubuntu/Apache 2.2.22/MySQL 5.6.34/PHP 7.1.22/DragonFly 10.0.48.9418


Here's a simple block if you just want to monitor,<?php /******************************************************* * CPG DragonflyCMS Server Load ********************************************************/ if (!defined('CPG_NUKE')) { exit; } if ($load = exec('uptime')) { $content = '<div style="text-align:center;">'; preg_match("/averages?: ([0-9\.]+),[\s]+([0-9\.]+),[\s]+([0-9\.]+)/", $load, $avgs); $content .= $avgs[1].' - '.$avgs[2].', '.$avgs[3]; $content .= '</div>'; } else { $content = 'ERROR'; return trigger_error('exec function doesn\'t appear to be available', E_USER_WARNING); } ?>

Server specs (Server OS / Apache / MySQL / PHP / DragonflyCMS):
Ubuntu/Apache 2.2.22/MySQL 5.6.34/PHP 7.1.22/DragonFly 10.0.48.9418

All times are UTC
This forum is locked: you cannot post, reply to, or edit topics. Forum IndexRequests
Page 1 of 1