 |
Your forum announcement here! |
|
 |

11-06-2007, 13:49
|
 |
Senior Member
|
|
Join Date: Feb 2007
Location: Darlington
Posts: 101
|
|
[url=http://www.eukhost.com/vps-hosting.php]VPS Hosting[/url] Mount Points
Hello
I noticed that the following are mounted on my VPS Hosting
Code:
> mount
/dev/simfs on / type reiserfs (rw,usrquota,grpquota)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid)
proc on /proc type proc (rw,nodiratime,nosuid,nodev,noexec)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,nosuid,noexec)
Can you tell me what the tmpfs drive's are for? df tell's me that they are 2G each
Code:
> df -h
Filesystem Size Used Avail Use% Mounted on
/dev/simfs 10G 5.0G 5.1G 50% /
tmpfs 2.0G 0 2.0G 0% /lib/init/rw
tmpfs 2.0G 0 2.0G 0% /dev/shm
but if I try to write anything above around 3.5MB on it, it say's that there is no space left on the drive.
Code:
> ln -s /dev/shm /tmpfs
> dd if=/dev/zero of=/tmpfs/swapfile bs=1024 count=512000
dd: writing `/tmpfs/swapfile': No space left on device
3381+0 records in
3380+0 records out
3461120 bytes (3.5 MB) copied, 0.022085 seconds, 157 MB/s
Any idea's?
|

11-06-2007, 14:52
|
 |
System Administrator
|
|
Join Date: Mar 2007
Posts: 93
|
|
Hello,
tmps is a temporary folder like /tmp, on your VPS Hosting which is created on the RAM of main hardware node and its a virtual folder. Also please don't try to write anything on it as it may create problems on your VPS Hosting.
|

11-06-2007, 18:21
|
 |
Premium Member
|
|
Join Date: Apr 2007
Location: Manchester, United Kingdom
Posts: 5,867
|
|
Yes, I also imagine as well as causing problems that things are regularly deleted and the tmpfs folder is emptied so there wouldn't be much point in saving something to it!
Hope that helps  .
|

14-06-2007, 07:42
|
 |
Senior Member
|
|
Join Date: Feb 2007
Location: Darlington
Posts: 101
|
|
I know what tmpfs is, I was just wondering why they are there. If I can't write to them in the risk of causing problems, then what's the point in them being mounted??
Well I wasn't planning on writing anything to it that I would want to keep permanently, more like writing stuff to it in the form as a cache; opcode, rendered templates that sort of thing.
|

14-06-2007, 08:25
|
 |
System Administrator
|
|
Join Date: Mar 2007
Posts: 93
|
|
Hello,
tmps partition isn't a real partition. What it basically does is to create a ramdisk on the hardware node for the VPS Hosting, of which the disk usage isn't accounted towards the quota of the rest of the VPS Hosting. The usage is accounted against the "shmpages" of the VPS Hosting, which can only be set from the hardware node. As it's a ramdisk, all data on the tmps 'partition' will be lost after a reboot.
|

14-06-2007, 12:06
|
 |
Senior Member
|
|
Join Date: Feb 2007
Location: Darlington
Posts: 101
|
|
Quote:
|
Originally Posted by Sam
Also please don't try to write anything on it as it may create problems on your VPS Hosting.
|
So what is the risk of writing to the tmpfs? Or should I just use shmop or memcache functionalities in php instead? I'm not expecting any long term persistence from it like I said, it would be just for a cache.
|

14-06-2007, 12:23
|
 |
System Administrator
|
|
Join Date: Mar 2007
Posts: 93
|
|
Hello,
tmpfs partition is not available on your VPS Hosting, its on the main hardware node on which your VPS Hosting is hosted. It is created only for the VPS Hosting temp files which are used to run (run-time) a VPS Hosting without using disk-space of a VPS Hosting. If you want to write any files for temporary basis you have to use the "/tmp" directory of your VPS Hosting.
|

15-06-2007, 08:25
|
 |
Premium Member
|
|
Join Date: Apr 2007
Location: Manchester, United Kingdom
Posts: 5,867
|
|
As if the tmpfs folder wasn't there it would start eating into your own space on your VPS Hosting.
Is there really any difference to you writing your temporary information to tmp rather than tmpfs? 
|

15-06-2007, 11:00
|
 |
Senior Member
|
|
Join Date: Feb 2007
Location: Darlington
Posts: 101
|
|
Yes it does make a difference, performance!
Here's writing a 1MB file to disk
Code:
root@VPS Hosting202:/home/rob# dd if=/dev/zero bs=1024 count=1024 of=/tmp/tempfile
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.011043 seconds, 95.0 MB/s
Here's writing a 1MB file to memory, more than twice as fast.
Code:
root@VPS Hosting202:/home/rob# dd if=/dev/zero bs=1024 count=1024 of=/dev/shm/tempfile
1024+0 records in
1024+0 records out
1048576 bytes (1.0 MB) copied, 0.00553 seconds, 190 MB/s
So if I wanted to write a caching mechanism that just used files, it would be nice and simple to write them to a tmpfs as I could just treat them as files. However if I can't write to a tmpfs, then I'd have to write to shared memory which is a little bit more complicated.
|

16-06-2007, 14:19
|
 |
Premium Member
|
|
Join Date: Apr 2007
Location: Manchester, United Kingdom
Posts: 5,867
|
|
OK you do seem to have a point  . The difference although visible doesn't seem to be that huge though unless you are writing files of hundreds of gigs at a time which would be a few seconds slower using tmp. I assume though that your file sizes are much smaller than this though!
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is On
|
|
|
All times are GMT. The time now is 11:52.
|
|
|