Zentyal Forum, Linux Small Business Server

Zentyal Server => Installation and Upgrades => Topic started by: djedge on September 20, 2012, 06:46:12 pm

Title: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: djedge on September 20, 2012, 06:46:12 pm
Hi,

My zentyal 3.0 (Clean install) is having a problem. I've been monitoring performance since it was installed on 9/14/2012. The process manage-logs is using at random a huge amt of cpu (50-100% of one core of the quad core cpu) and also using 80-90% of ram on the server at times. This behavior is affecting performance in a fairly negative way i believe.

I have tried disabling both the logs module and the bandwidth monitor and neither of these help. This does not happen 100% of the time but is a majority of the time it seems.

Has anyone had this issue or know of a solution?

All components are up to date as well as all ubuntu updates.

Thanks!
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Sam Graf on September 20, 2012, 09:26:18 pm
I can confirm your description of the problem (the numbers were different for me but the substance of the problem was the same). I can't give you a solution, since nothing I tried stopped it.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: djedge on September 20, 2012, 10:26:56 pm
yeah, it's a real bummer. 3.0 is so much better than 2.2 as far as features, UI, etc. But with this kinda of bug i may have to revert back to 2.2-2 ... Clients are already complaning. :(
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Sam Graf on September 21, 2012, 04:32:10 am
Thankfully I'm under no pressure to deploy. I think the developers will sort the issue as quickly as possible, hopefully soon enough that you can hang on to your 3.0 installations.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: christian on September 21, 2012, 07:25:54 am
Given the huge amount of in-depth changes in term of architecture, I'm not surprised to face some glitches with 3.0
I should not say that but rushing to go live in prod with this release, even if this is no more RC, is a bit optimistic  :-\

No doubt Zentyal team is working very hard (days and night for what I understand) to solve all bug but it will take some time in any case. If you can't afford it, stay with 2.2 for a couple of week, at least from my standpoint.
e.g. yesterday night I updated my 3.0 test platform: after system update, GUI became unresponsive and I had to restart Zentyal from CLI.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: djedge on September 21, 2012, 07:38:13 am
I have not had any problems with the GUI and i'm quite happy with that aspect.

The only two problems i've had were the cpu usage / memory issues with manage-logs process..  and with samba / file sharing refusing to configure (Which i gave up on for now).

Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Marcus on September 21, 2012, 12:57:06 pm
Hello.

You high CPU load could also come from your swap.

You should check your swappiness...

Quote
Swappiness is a property for the Linux kernel that changes the balance between swapping out runtime memory, as opposed to dropping pages from the system page cache. Swappiness can be set to values between 0 and 100 inclusive. A low value means the kernel will try to avoid swapping as much as possible where a higher value instead will make the kernel aggressively try to use swap space. The default value is 60, and for desktop systems, setting it to 100 may affect the overall performance, whereas setting it lower (even 0) may improve interactivity (decreasing response latency.)

Short story;
First, check it out using a shell cmd:
Code: [Select]
cat /proc/sys/vm/swappiness
It should return "60"

If that is the case, you have a hardware/software bad configuration. You'll have to either increase your RAM or stop/tweak some services. If you can't or want a quick fix, please keep reading.

Please run this cmd in your shell:
Code: [Select]
sudo sysctl vm.swappiness=10
Following this cmd, executing the previous one should return "10"

Now let's make it persistant (following a reboot);
Paste this bloc in your shell:
Code: [Select]
sudo cat >> /etc/sysctl.conf <<-SWAPPINESS
cat vm.swappiness = 10
SWAPPINESS

Now we must restart the swap in order to empty it;
Paste this cmd in your shell:
Code: [Select]
sudo swapon -av && sudo swapoff -av(it may takes few seconds/minutes so be patient)

Hope this will help

Marcus
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: christian on September 21, 2012, 01:09:10 pm
Marcus,

Look at swap activity is a good point.

I though however that swappiness value was only reflecting how Ubuntu will be prone to swap or not but not reflecting whenever some swap occurs  ???
Furthermore swappiness = 60 is the standard value for desktop. Is it suitable for Ubuntu server ?
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Sam Graf on September 21, 2012, 03:32:40 pm
Swap comes into play but as effect, not cause, in this particular case, I think. As djedge noted, we have a process or two (in my case MySQL along with manage-logs) that is consuming significant resources for long periods. And in my case, the longer the uptime, the longer manage-logs hogged resources. Eventually, it ran continually.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: djedge on September 21, 2012, 04:14:11 pm
I have noticed that mysql is also a culprit...   Sometimes mysql is the main culprit , sometimes it's manage-logs.  This of course leads me to believe manage-logs is running tons of mysql queries as mysql might be 90% cpu while manage-logs is 10-20% at the same time.

I can easily change the swappiness value but in reference to the previous post i thought 60 was recommended for server installs on ubuntu... (Which is why it's the default).

Lowering the swappiness might delay performance degradation but the long term effect is still the same, mysql / manage-logs will thrash eventually.

Also , I currently have 2gigs allocated to the zentyal VM (running on esxi 5.1). I can increase the ram easily however 2 gig should be more than sufficient for just the firewall / gateway . I'm not running office or communication aspects of zentyal.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Marcus on September 22, 2012, 06:52:13 pm
Hello,

Quote
swappiness = 60 is the standard value
Quote
i thought 60 was recommended for server installs on ubuntu... (Which is why it's the default).
It is much more the "default" than the "recommended" setting.  IMO, "Recommended" is what you need it to be depending your computer vocation. 

Quote
I though however that swappiness value was only reflecting how Ubuntu will be prone to swap or not but not reflecting whenever some swap occurs
As far that my understanding of it goes, yes, that is totally correct.

According to the official Ubuntu Website:
Quote
The default setting in Ubuntu is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical Ubuntu desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.

ref:
https://help.ubuntu.com/community/SwapFaq

With that said;
For desktops or database servers, IMO, swappiness = 10 is the configuration that work the best (try running Chrome or Firefox while swapping -> Only do it if you like "grayed, static, non-responsive windows" :) ).

We must keep in mind that swap = drive use.  HDD and SSD are slow memory. RAM is much more fast.

IMO, caching a database in RAM is a smarter aproach since it is less using/putting pressure on physical drives.  This also comes from the fact that logs requires a lot of read/write on a physical device.  The selected media used mathers.

Short story;
Load balancing the hardware ressources simply makes everything run faster.


Some other thinking;
Quote
This of course leads me to believe manage-logs is running tons of mysql queries as mysql might be 90% cpu while manage-logs is 10-20% at the same time.
When CPU is toping up, usually, this mean that there is "things to be done" waiting in the CPU queue.  If you are swapping, this is an even more common scenario (hard drives are busy handing or writing things.  Either on the swap partition, in your logs or in your DBs.).

That multi-tasking philosophy is driving a lot of server administrators to dedicate a full HDD or SSD for the swap.


Quote
Swap comes into play but as effect, not cause, in this particular case, I think.   
Well, yes and no...  When swap comes into play, things will just go worst and worst and worst and ... (hard drives are kinda slowing their response time down so getting less things done - downward spiral scenario)

One last thing;
Try checking your logging policies.  Being to much of a "big brother" will slow you down.

[Off Topic]
Quote
And in my case, the longer the uptime, the longer manage-logs hogged resources. Eventually, it ran continually.
You can do better - garanteed! 
My Zentyal 2.0 multi tasking home server build on a 4X WD Green 5400RPM soft RAID10/RAID1 (the full 2.0 setup except the PBX side that was replaced by FreePBX + much hacking on top of it like suPHP and a rethinked FTP module) had only very few reboots (once every power failure). The Zarafa indexer is the only thing that chews up 50% of my AMD 5400 dual core.  And on top of that, it does have a total of 2GB of RAM.
[/Off Topic]

I hope this will help

Best,

Marcus
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Sam Graf on September 23, 2012, 01:15:59 am
Marcus, while I don't disagree with your general point, this is something 1) new to 3.0, and 2) not consistent even in 3.0, as far as I can tell. I have never seen MySQL (say, in a LAMP configuration) just run constantly. I'm suspicious of the log process itself (as I already mentioned, I was logging events and DHCP with one attached client--not even close to a Big Brother) because the logs themselves are behaving strangely, as noted by other users.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: eisveldt on September 23, 2012, 05:27:06 pm
Hello, just want to confirm the issue, i have it to.

I did a strace on the manage-logs process and i looks like a loop of some sort and it cant find some path etc.

Its a good concept, and a good framework with slow but good looking GUI.
But!! Over all Z3.0 feels unstable and i would not recommend it in production environment.
My HW is Intel dual core and 2Gig memory and i test it for routed proxy with AV and content filtering.
Some other issues is Zentyal apache is stoping preventing me from administrating, OK i can start it up.
Other processes stoped randomly like HTTP proxy and network services etc.

Keep up the good work and i hope we soon can see a reel RC 3.0.

Best regards Jimmy
 
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Sam Graf on September 23, 2012, 06:44:41 pm
Hi, and welcome!

I agree that Zentyal 3.0 seems to have some rough edges, probably largely because it's a major update ( the first Zentyal release built on top of Ubuntu 12.04 LTS). I think the developer's effort to leverage new Samba features has probably contributed to some of the rough edges.

That said, in my experience the Zentyal developers work pretty hard at making their software a quality product. Even if 3.0 final was released prematurely, I have no doubt that they're concerned about fixing things as quickly as possible and having a very stable product. We can help them by continuing to file and monitor bug reports for reproducible issues and discuss possible problems (constructively) here in the forums.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: omata on September 24, 2012, 12:42:27 am
Hello.

You high CPU load could also come from your swap.

You should check your swappiness...

Quote
Swappiness is a property for the Linux kernel that changes the balance between swapping out runtime memory, as opposed to dropping pages from the system page cache. Swappiness can be set to values between 0 and 100 inclusive. A low value means the kernel will try to avoid swapping as much as possible where a higher value instead will make the kernel aggressively try to use swap space. The default value is 60, and for desktop systems, setting it to 100 may affect the overall performance, whereas setting it lower (even 0) may improve interactivity (decreasing response latency.)

Short story;
First, check it out using a shell cmd:
Code: [Select]
cat /proc/sys/vm/swappiness
It should return "60"

If that is the case, you have a hardware/software bad configuration. You'll have to either increase your RAM or stop/tweak some services. If you can't or want a quick fix, please keep reading.

Please run this cmd in your shell:
Code: [Select]
sudo sysctl vm.swappiness=10
Following this cmd, executing the previous one should return "10"

Now let's make it persistant (following a reboot);
Paste this bloc in your shell:
Code: [Select]
sudo cat >> /etc/sysctl.conf <<-SWAPPINESS
cat vm.swappiness = 10
SWAPPINESS

Now we must restart the swap in order to empty it;
Paste this cmd in your shell:
Code: [Select]
sudo swapon -av && sudo swapoff -av(it may takes few seconds/minutes so be patient)

Hope this will help

Marcus

Hi,

I posted the very same issue at Spanish forum, so in my case 'manage-log' is hogging both, memory and CPU, then browsing tasks at workstations are stopped, all clients get an 102 error and the system almos freeze because of resource consumption levels. My server is an AMD Sempron based system, using 4 GB of RAM; my previous device with Z2.2 has only 1 GB and worked a lot better even without use all the RAM neither CPU.

Then, I tried the directions for change and turn permanent the swappiness thing, so when I pu the following in the shell:

Code: [Select]
sudo cat >> /etc/sysctl.conf <<-SWAPPINESS
cat vm.swappiness = 10
SWAPPINESS

I get:

Code: [Select]
-bash: /etc/sysctl.conf: Permission denied

So, I just want to know, where I can find the installation information related to 2.2 version, because repository info was removed from installation page. In the other hand 'dansguardian' isn't behaving like 2.2 too, it is blocking update process when an ubuntu workstation run apt-get update and apt-get upgrade, the only thing that let me run without issue the update command in ubuntu/debian workstations is disable dansguardian/web-filtering, squid works fine.

Best regards,

Oscar.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: EddieA on September 24, 2012, 07:50:18 pm
I was going to open a new thread on the high CPU issues I've been seeing, but maybe this is the right place, even though I couldn't tie it down to Logs usage.

I've tried installing both the RCs and the released 3.0 64-bit version, in an ESXi VM, and in all cases have seen some form of 100% CPU usage causing a stall and lockout of the Administration interface, at which point I'm never sure if the actions are completed or not.  The only way out, I've found is to re-boot.

I've attached a couple of screen shots, to show that these are not just transitory occurrences.  The first shows the CPU usage over an hour, showing that the CPU usage is almost constantly at 100%.  The dips in the graph are, from memory, when the browser threw the "Script not responding" pop-up.  Other than responding to the pop-ups, where I actually could, there was nothing else going on.  I was the only user connected.

On the times I have been able to get a "top" running, the processes that appear to be using the CPU are a mix of everything, mostly unexpected, as can be seen in the 2nd screen shot.  However, it is definitely Firefox using the most.

Cheers.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: HyperionTech on September 24, 2012, 09:25:48 pm
Definitely an issue, on one of my clients system 'loggerd' was holding the overall CPU usage at 45%+ continuously. I had to Disable the Logs Component until this issue is addressed. I also attempted the suggested modification to "swap".

My Zentyal.log show this continually:
Code: [Select]
2012/09/24 12:00:06 ERROR> MyDBEngine.pm:141 EBox::MyDBEngine::_disconnect - There wasn't a database connection, check if database exists\n

However it ceased once I disabled the Logs Component.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Sam Graf on September 25, 2012, 04:21:42 pm
Regrettably I have had to take some time off from 3.0 testing so I can't try this myself, but has anyone attempted the temporary fix outlined here:

http://trac.zentyal.org/ticket/5168

and reported earlier here:

http://trac.zentyal.org/ticket/5080

?

I did make the change but 3.0.1 stopped responding before I could really check things out. :(
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Javier Amor Garcia on September 26, 2012, 05:03:56 pm
Until we fix it, you can disable the consolidation process  in /etc/zentyal/logs.conf . To do change the configuration key 'disable_consolidation' to 'yes'
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: omata on September 27, 2012, 10:47:43 pm
Hi,

Latest update (3.0.2) just doesn't fix the issue with 'manage-log' cron process.

Regards,

Oscar.
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: omata on September 27, 2012, 10:48:35 pm
Until we fix it, you can disable the consolidation process  in /etc/zentyal/logs.conf . To do change the configuration key 'disable_consolidation' to 'yes'

Thank you!
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Javier Amor Garcia on October 01, 2012, 01:37:51 pm
There is a no-published fix available, see http://trac.zentyal.org/ticket/5080#comment:14
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: Adelson on October 01, 2012, 05:41:31 pm
Hi Javier,
I have applied the fix on two servers, and it worked !
One is a AMD 8150 with 8Gig RAM and a RAID5 array with 6 HDs (no reboot needed)
Other is Core2 Duo with 4Gig RAM and a RAID1 array with 2 HDs (only after reboot)
The MYSQL Deamon and manage-logs stopped eating RAM and CPU.

Thanks a lot !
Title: Re: Zentyal 3.0 manage-logs process using 50-100% cpu and using 80% RAM
Post by: darthanubis on October 01, 2012, 09:52:07 pm
Hi Javier,
I have applied the fix on two servers, and it worked !
One is a AMD 8150 with 8Gig RAM and a RAID5 array with 6 HDs (no reboot needed)
Other is Core2 Duo with 4Gig RAM and a RAID1 array with 2 HDs (only after reboot)
The MYSQL Deamon and manage-logs stopped eating RAM and CPU.

Thanks a lot !
:D Instantly fixed for me, on Core2Duo 4gbram x64 SSD