LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (http://www.linuxquestions.org/questions/linux-general-1/)
-   -   tmpfs (http://www.linuxquestions.org/questions/linux-general-1/tmpfs-217879/)

akuate 08-15-2004 10:24 AM

tmpfs
 
Hi,

I am a software guy and have little knowledge of the Linux OS. We are hosting our website on Linux OS. While doing some performance tuning of the website, I came across the suggestion of using tmpfs for the tmp folder using the following command

mount tmpfs /tmp -t tmpfs -o size=64m

However as soon as I do this, Apache stops working. Also if I reboot my Linux box, this mount goes away. Can you please guide me whats happening.

Thanks a lot for your help

trickykid 08-15-2004 10:33 AM

When you mount it from the command line, its just storing it in memory, hence when you reboot, it goes away cause you haven't created it so it automounts during bootup.

You can do this by editing your /etc/fstab file and adding it there. Also it might make apache stop working as it could have had files in /tmp, mounting tmpfs over it wipes them out, etc.

Shutdown apache, add the entry, mount it, restart apache and see if that works. And you can then reboot to test if it mounts properly at boot time.

akuate 08-15-2004 11:43 AM

I tried stopping apache, applying the mount command and then restarted apache. However, my app failed though Apache starts fine.

Thanks a lot for the quick response.

trickykid 08-15-2004 12:05 PM

Well to tell you the truth, you can use tmpfs but I'd make it bigger than 64 megs.. I usually stick with at least 800 megs or more for the /tmp directory. Its not necessary but if you already have your /tmp setup on its own partition or on a partition with plenty of space, I'd just leave it be.

akuate 08-15-2004 12:17 PM

On doing a df on my linux prompt apart from the other partitions(I presume they were partitions, please excuse my ignorance but I really dont have any idea about the partitions), it gave the following info for /tmp

/dev/sda6 1035660 49360 933692 6% /tmp

Do you feel, moving this part into the RAM would give us no performance benefit as such?

Thanks a lot for your help

trickykid 08-15-2004 12:22 PM

Quote:

Originally posted by akuate
On doing a df on my linux prompt apart from the other partitions(I presume they were partitions, please excuse my ignorance but I really dont have any idea about the partitions), it gave the following info for /tmp

/dev/sda6 1035660 49360 933692 6% /tmp

Do you feel, moving this part into the RAM would give us no performance benefit as such?

Thanks a lot for your help

What's your machine specs? That really all depends on that, how many users or hits the machine takes, etc.

And if you want an easier readable format for df, do a df -h

the -h means human readable :)

akuate 08-15-2004 12:35 PM

The more readable form :)

/dev/sda6 1012M 49M 912M 6% /tmp

As for the machine specs

Dual Xeon processor(2.8 GHz)
3 GB RAM

As for the hits, the max load that we have experienced so far is 3000 concurrent users. Also during this load period they are on a page which gets refreshed with new data every 40 seconds.
Dont know whether this information is sufficient. Do let me know please.

Thanks a lot for the help

trickykid 08-15-2004 12:48 PM

Quote:

Originally posted by akuate
The more readable form :)

/dev/sda6 1012M 49M 912M 6% /tmp

As for the machine specs

Dual Xeon processor(2.8 GHz)
3 GB RAM

As for the hits, the max load that we have experienced so far is 3000 concurrent users. Also during this load period they are on a page which gets refreshed with new data every 40 seconds.
Dont know whether this information is sufficient. Do let me know please.

Thanks a lot for the help

I'd say with those specs, you shouldn't or probably couldn't tell a difference mounting /tmp as tmpfs into memory or leaving it as it is. Expecially since your only using 6% of your space allocated for /tmp

akuate 08-15-2004 12:53 PM

I see what you are saying. Thanks a lot for your help, I guess there is no benefit I will see here.

trickykid 08-15-2004 01:02 PM

Quote:

Originally posted by akuate
I see what you are saying. Thanks a lot for your help, I guess there is no benefit I will see here.
Yeah and if this is mainly a web server serving to poeple, most of apache's processes are going to get loaded into ram anyways. Majority of the time /tmp will get used for those actually logging directly into the server, etc.

But yeah, no problem, glad to help out.


All times are GMT -5. The time now is 04:48 AM.