Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Cacti using too much processes after gcc upgrade [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Majed17
Guru
Guru


Joined: 31 Aug 2011
Posts: 328
Location: Minsk, Belarus

PostPosted: Thu Jul 05, 2018 9:04 am    Post subject: Cacti using too much processes after gcc upgrade [solved] Reply with quote

Peace,
Code:
gcc-config --list-profiles
 [1] x86_64-pc-linux-gnu-7.3.0 *
 dmesg
[    0.000000] Linux version 4.14.52-gentoo (root@cacti) (gcc version 7.3.0 (Gentoo 7.3.0-r3 p1.4)) #2 SMP Thu Jul 5 09:18:12 +03 2018

https://pastebin.com/QKrMJpZu
I did add a few hosts but the impact was not noticed until the gcc upgrade!
_________________
Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort.


Last edited by Majed17 on Mon Jul 09, 2018 7:37 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9708
Location: almost Mile High in the USA

PostPosted: Thu Jul 05, 2018 2:11 pm    Post subject: Reply with quote

Your question isn't clear, what are you trying to point at? Just that there's a lot of apache2 processes spawned?

Did you make any other changes to your apache configuration? Is it still working?

Are you being DDoS'ed? Do you naturally have this much traffic now?

I'd imagine the number of processes shouldn't increase with a gcc change, though the number of threads may (I think GCC is trying to sort of automatically LWT multithread applications now?) However these are processes, which sort of indicates something else happening here.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Majed17
Guru
Guru


Joined: 31 Aug 2011
Posts: 328
Location: Minsk, Belarus

PostPosted: Fri Jul 06, 2018 6:12 am    Post subject: Reply with quote

Well earlier to that there was a php upgrade and it required to change the php apache cli and so on to the 7.1 version. That might have something to do with it. I get notifications that there are 229 processes used and after some time it drops to 190's then to way below 130's. I can't be ddos'ed since I have no open ports to the internet on this machine. Adding 4 extra routers to cacti can not possibly cause this spike in cacti.
I have no idea what gcc does except that it is a critical part of the system :)
_________________
Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9708
Location: almost Mile High in the USA

PostPosted: Fri Jul 06, 2018 2:04 pm    Post subject: Reply with quote

Could you check your apache logs, see what's causing the processes to spawn?

I think /var/log/apache/access_log --

Oh... now I think I understand, are you using net-analyzer/cacti? I was a bit baffled as I don't use this software and your computer was named cacti.

How many people are accessing these webpages, been refreshing the pages a lot in your browser?

Also did an etc-update or change in /etc/apache2/modules.d/00_mpm.conf occur?

In any case, gcc is quite important to Gentoo as it converts what humans write as software to what the computer can actually run. After your computer is fully installed, gcc is actually optional. However for Gentoo, gcc is needed to install upgrades - because it's source-based - so removing it would cause you to lose upgrade abilities. Otherwise there are other Linux distributions that can omit gcc for servers that otherwise has no need for it.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Majed17
Guru
Guru


Joined: 31 Aug 2011
Posts: 328
Location: Minsk, Belarus

PostPosted: Sat Jul 07, 2018 11:36 am    Post subject: Reply with quote

in error_log,
I have this repeating since feb 23
Code:
PHP Warning:  SNMP::get(): Fatal error: Timeout in /var/www/localhost/htdocs/cacti/lib/snmp.php on line 472

snmp.php, the concerned section:
Code:
try {
      $out = $session->get($oid);
   } catch (Exception $e) {
      $out = false;
   }


I went to the cacti logs and saw that there is a host that is timing out... more than 500ms lag...I thought maybe disabling the host would remove the excess processes, but it turned out to be a fairy tale.
Interestingly, yesterday all day, the problem did not occur.
in access_log it just shows the real time windows I have open which have not changed in quantity. I used to open them in firefox but it would max the cpu so I started using edge with much better results.
the conf file has not been changed.
So what do you advise?
_________________
Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort.
Back to top
View user's profile Send private message
Majed17
Guru
Guru


Joined: 31 Aug 2011
Posts: 328
Location: Minsk, Belarus

PostPosted: Mon Jul 09, 2018 7:36 am    Post subject: Reply with quote

Today, apache reported that max worker has been reached and graphs are no more! I swisscowed the error and it led to a thorough inspection of the system, there too the first thing to check is ddos attacks. later on I htoped and the maximum cpu using process was mysql. As advised by you, I checked the mysql error log and there was a damaged cacti database demanding a repair. Swisscow led to stackoverflow with a command to repair all databases. After restarting mysql and forcing a check on the number of processes, the system healed up. thank you for your tips.
MysqlTuner is a life saver
credits to this site:
https://globedrill.com/mysql-high-cpu-usage-mysql-process-high-server-load/
_________________
Seek and you shall find, Knock and it shall be opened, cry and you shall find comfort.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum