LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
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 01-28-2016, 08:43 AM   #1
roni.baby
LQ Newbie
 
Registered: Jan 2016
Posts: 4

Rep: Reputation: Disabled
Mysql server created temprary tables into HDD


We are developing a application using wordpress as its base.Application development is almost done and its time to go into production.Now we are doing the performance improvements in server side

Here is our application deployment architecture

Server1 (CentOS7): Nginx and php-fpm
Server2 (Percona MySQL 5.6)

Our issue is when we run mysqltuner.pl script in mysql server i am getting Temporary tables created on disk: 69% (7K on disk / 10K total)

I think the temporary table created on HDD space reduced the application performance. How to avoid to creating it into HDD instead of its memory?
 
Old 01-28-2016, 11:57 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 447Reputation: 447Reputation: 447Reputation: 447Reputation: 447
Hello

http://dev.mysql.com/doc/refman/5.6/...ary-files.html

Are you sure it really is a problem?

You have 7k used. Mysql will always use temp files for some operations. For example "ALTER TABLE ..." will usually use it. If it does use the disk a lot, it can help to raise the size of some buffer. But you will have to investigate what the problem really is.

Or you could simply setup a ramdisk for /tmp with tmpfs.

https://wiki.centos.org/TipsAndTricks/TmpOnTmpfs
 
Old 01-28-2016, 07:34 PM   #3
jamick
LQ Newbie
 
Registered: Feb 2007
Posts: 6

Rep: Reputation: 0
How big is your database? And how much memory do you have? Transaction rate? Mostly readers or mostly writers?
 
Old 01-29-2016, 02:22 AM   #4
roni.baby
LQ Newbie
 
Registered: Jan 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Thanks for your reply.
Our database server is a 2GB CentOS system. and here is the my.cnf values

# CACHES AND LIMITS #
tmp-table-size = 256M
max-heap-table-size = 512M
query-cache-type = 1
query-cache-size = 16M
max-connections = 500
thread-cache-size = 50
open-files-limit = 65535
table-definition-cache = 4096
table-open-cache = 512

# INNODB #
innodb-flush-method = O_DIRECT
innodb-log-files-in-group = 2
innodb-log-file-size = 128M
innodb-flush-log-at-trx-commit = 1
innodb-file-per-table = 1
innodb-buffer-pool-size = 768M
innodb_buffer_pool_instances = 1
innodb_sort_buffer_size = 2M
 
Old 01-29-2016, 10:02 AM   #5
jamick
LQ Newbie
 
Registered: Feb 2007
Posts: 6

Rep: Reputation: 0
@Guttorm's suggestions are right on and are in line with the DBA's (me) perspective. Without an idea of how the database is being used and the projected transaction count, it would be hard to tune MySQL's performance. When you say a 2GB Centos system, what do you mean? 2GB of RAM? If your application is of the LAMP variety and you need performance, having the temp area on a spindle might not be the first issue to address because there will be more to tune outside of running from a disk. Is your machine dedicated to running the database or does it also run the application?
 
Old 01-29-2016, 10:08 AM   #6
jamick
LQ Newbie
 
Registered: Feb 2007
Posts: 6

Rep: Reputation: 0
My apologies, totally glazed over the architecture bit from above.
 
  


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
Has anyone created a MySql cluster with MYIASM and InnoDB Tables h.dilshad Linux - Newbie 5 04-26-2013 03:21 AM
MySQL Server fails to start after hdd was full Floix Linux - Server 3 09-18-2009 06:59 PM
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option s Braynid Linux - Newbie 1 06-08-2006 08:14 PM
mysql reinstallation distorted by previous tables in /var/mysql mad4linux Linux - Software 0 10-04-2005 01:39 PM

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

All times are GMT -5. The time now is 06:50 PM.

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