/var/tmp size increasing. MYD file eating memory

tmp

i don't know much about linux file's system. there is centos installed on my machine. suddenly my web stopped working. sql_2031_0.MYD file in /var/tmp/ getting large when something browses in website. it consumes memory and web stopped opening at 100% filling of tmp. i knew there were some deleted files which was taking memory. i set memory to 0 using

ls -l /proc/7415/fd/10618322

all deleted files are using 0 memory now after this. checked wilth below command

 sudo lsof | grep deleted

here you can view db info and DF output

http://i.stack.imgur.com/T4nSU.jpg
Direct Image Link

Best Answer

I would guess that your website is backed by a MySQL database, which has one or more queries that are either so complex or so badly written that they are spooling through more data than the server can handle. Either that, or the queries are entirely reasonable and it's the server that has been woefully mis-specified/configured.

Either way, I would say that MySQL is running out of memory and is choosing to spool the temporary data to an on-disk table. If the server is also showing a lack of available RAM, it is probably a sign that a RAM upgrade is necessary. If the server RAM looks OK, it is probably a sign that MySQL is not optimally configured to use the available RAM.

In any case, I would say your first step should be to contact your DBA. Request that (s)he examine the ongoing database activity for poorly-running queries and high temp space usage.

Of course, if you're the DBA, then https://dba.stackexchange.com/questions/30505/why-does-mysql-produce-so-many-temporary-myd-files might be a good place to start.