LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-25-2013, 02:01 AM   #1
l0pht
Member
 
Registered: Sep 2008
Posts: 79

Rep: Reputation: 1
Mysql crashes unexpectedly


HI
i have a centos server with dual core cpu and 2 gig RAM
just 4 sites hosted on it and a plesk for manage.
4 sites have around 15000 view and every minute update feed and save news in database.
but every 1 or 2 hour mysqld crashed and too slowly to show site contents.
but just when i restart mysqld service everything is okay...
what can i do for mysql for not crash?
thanks
 
Old 04-25-2013, 04:27 AM   #2
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,478

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
15,000 views per day or per minute?

If it's per minute and you're using apache and mysql on the same box then it is SERIOUSLY underpowered.

If it's per day, what log files have you checked?
 
Old 04-25-2013, 08:28 AM   #3
l0pht
Member
 
Registered: Sep 2008
Posts: 79

Original Poster
Rep: Reputation: 1
No,
15,000 views per day.
and per 1 minute websites read and update their feeds, feeds store in mysql
------------------------
i checked /var/log/mysql.log and it's says nothing for fix :

tail -f :
130425 18:06:35 mysqld_safe mysqld from pid file /var/run/mysqld/mysqld.pid ended
130425 18:06:37 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql
130425 18:06:37 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead.
130425 18:06:37 [Warning] option 'table_cache': unsigned value 536870912 adjusted to 524288
130425 18:06:37 [Warning] option 'thread_stack': unsigned value 65536 adjusted to 131072
130425 18:06:37 [Warning] option 'thread_cache_size': unsigned value 134217728 adjusted to 16384
130425 18:06:37 [Warning] Changed limits: max_open_files: 1024 max_connections: 50 table_cache: 482
130425 18:06:37 [Warning] No argument was provided to --log-bin, and --log-bin-index was not used; so replication may break when this MySQL server acts as a master and has his hostname changed!! Please use '--log-bin=mysqld-bin' to avoid this problem.
130425 18:06:37 InnoDB: Initializing buffer pool, size = 1.0G
130425 18:06:37 InnoDB: Completed initialization of buffer pool
130425 18:06:37 InnoDB: Started; log sequence number 250 282188107
130425 18:06:37 [Note] Event Scheduler: Loaded 0 events
130425 18:06:37 [Note] /usr/libexec/mysqld: ready for connections.
Version: '5.1.67-log' socket: '/var/lib/mysql/mysql.sock' port: 3306 Source distribution

what can i do?
thanks

Last edited by l0pht; 04-25-2013 at 08:37 AM.
 
Old 04-25-2013, 08:38 AM   #4
TenTenths
Senior Member
 
Registered: Aug 2011
Location: Dublin
Distribution: Centos 5 / 6 / 7
Posts: 3,478

Rep: Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553Reputation: 1553
Have you tried things like changing your feeds to 2 minutes instead of 1?

If it's taking more than a minute to process and insert the data from these feeds then you'll be generating a "race" condition which will clog your database with requests.

Try also increasing the various buffer sizes in your my.cnf

Enable slow query logging and see if there's any queries that are taking a long time to run.
 
Old 04-25-2013, 09:43 AM   #5
l0pht
Member
 
Registered: Sep 2008
Posts: 79

Original Poster
Rep: Reputation: 1
ok, i check it and answer this topic.
thanks thanks
 
Old 04-25-2013, 11:21 PM   #6
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
I strongly suspect 2GB RAM is too small
Code:
 130425 18:06:37 [Warning] Changed limits: max_open_files: 1024 max_connections: 50 table_cache: 482
.
 130425 18:06:37 InnoDB: Initializing buffer pool, size = 1.0G
Half of your RAM is taken up by the buffer pool and you only allow 50 cxns at any time.
Have you tried monitoring top over a period to see what's going on, inc swap usage.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Machine shutdown unexpectedly unexpectedly pinga123 Linux - Newbie 1 02-25-2011 03:48 PM
(Ubuntu Lucid) X crashes/quit unexpectedly, and respawns on tty8 aeternitas Linux - Software 1 08-24-2010 06:31 AM
Suggestion required: Firefox crashes unexpectedly!! owaispoul Linux - General 7 02-07-2010 04:19 AM
Mysql crashes after restart ... :( sys7em Slackware 1 11-24-2004 03:33 PM
mySQL Command Center 0.92 Crashes Often SForsgren Linux - Software 3 05-04-2003 11:48 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration