Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
03-04-2017, 09:50 PM
|
#1
|
LQ Newbie
Registered: Mar 2017
Posts: 2
Rep:
|
Restart services regularly?
Hi guys,
This is the first time I post, so I have a Debian server that holds a web application. This web application produces a lot of MySQL processes, in order to access the website I need to restart MySQL. Questions is, How bad is it to restart MySQL service or any other service in particular, is it bad practice to regularly do this?
|
|
|
03-04-2017, 10:03 PM
|
#2
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,593
|
Which version of Debian are you using, pre-SystemD (7 or earlier) or post-SystemD (8)? The service management differs depending on the init system. Please note, the more information you provide, the easier it is for us to help you. You might want to read this.
Stopping and restarting the service may pose a temporary inconvenience to any users who may happen to be connected when you do it, but, otherwise, it should be harmless.
It seems to me the underlying issue is, why does MySQL cause your system to have such issues? If you have to continually restart services, there seems to some type of resource or resource-utilization issue here.
|
|
|
03-04-2017, 10:10 PM
|
#3
|
Moderator
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,297
|
Welcome to LQ!
In general, if your web server periodically becomes unavailable due to too many open MySQL processes, it indicates a problem which must be solved. Restarting the MySQL server is not a fix, it only allows you to temporarily ignore the real problem.
To get help with the actual problem you will need to provide more information including some description of the applications that are running, how heavy your web traffic is, OS version and whether the server is hosted or physical, etc.
Have you looked at the running processes and logs to see what queries are keeping them open, or what processes fail to terminate properly? If so, what did they say?
|
|
1 members found this post helpful.
|
03-06-2017, 05:56 PM
|
#4
|
LQ Newbie
Registered: Mar 2017
Posts: 2
Original Poster
Rep:
|
Hello Guys,
Thanks for the quick responce, this is a Debian 8.7, I use this server as an IDS. I use suricata in this server and I get a lot of traffic since I collect syslog, OSSEC logs and NIDs traffic from a spanport. If I htop most of the running processes are for mysql. I will analyze the logs to see anything unusual thanks.
|
|
|
03-06-2017, 06:34 PM
|
#5
|
LQ Guru
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,892
|
I confess to be totally confused by what you actually mean when you say that "running processes are for MySQL."
There would of course be only one "MySQL server" process.
Various MySQL configuration parameters allow you to control how many queries will be "under way" at any particular time, obliging all other requests to wait their turn. It sounds to me like you need to avail yourself right-away of some of these adjustments!
"In any case, 'no.'" Services might well run for many weeks or months at a time.
|
|
|
03-06-2017, 09:31 PM
|
#6
|
LQ Guru
Registered: Jan 2006
Location: Virginia, USA
Distribution: Slackware, Ubuntu MATE, Mageia, and whatever VMs I happen to be playing with
Posts: 19,593
|
In my experience, MySQL can spawn multiple processes.
I have it running locally as part of my project get my website to run on localhost using native Slackware packages, because I want to. I'm not really doing anything with it right now other than running it at startup (I've got to resolve some issues with PHP and Apache), but I still get this:
Code:
bash-4.4$ ps -A | grep sql
1556 ? 00:00:00 mysqld_safe
1646 ? 00:04:11 mysqld
2038 ? 00:04:24 mysqld
mysqld_safe is the server process itself. I'm not knowledgeable to know exactly what spawned the other two mysqld process, but I assume OP is referring to something along the above lines.
Last edited by frankbell; 03-06-2017 at 09:40 PM.
|
|
|
03-06-2017, 10:10 PM
|
#7
|
Member
Registered: Oct 2016
Distribution: iPadLinux
Posts: 81
Rep:
|
The LQgurus are very correct that, basically/generally, Unix things don't need restarting UNLESS a configuration issue!
Web searches seem to reveal specific ways to collect more info; try maybe: mysql high cpu usage
Once you uncover enough clues, you will get the solution! Welcome to LQ!
|
|
|
All times are GMT -5. The time now is 10:34 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|