Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I recently bought OpenVZ VPS and compared to a dedicated servers rm -rfoperation takes considerably longer to complete (about 4x - 5x longer). This is case even if there is one big file as opposed to many small files in directory. The server have it's own dedicated hard drive and is otherwise very fast on other tasks. Filesystem type is simfs

I use Debian 6, but tried CentOs 5.5 and Debian 5 as well. Is this normal behavior of OpenVZ VPS's? Are there any possible tweaks or other ways of deleting files faster than rm -rf?

share|improve this question
    
What are the underling drives (7200 rpm, 15k rpm, ssd?), type of raid, the storage interconnect (fc, sas, sata?), what type of software layers (nfs, iscsi, zfs, dedup?)? –  Aleksandr Levchuk Aug 22 '11 at 1:37

3 Answers 3

up vote 1 down vote accepted

If you have a data set that you delete regularly it is sometimes faster to put it on a different partition and then unmount+mkfs that partition. Depending on the number of files that will be considerably faster than rm -rf.

Regarding the performance, it might be worthwhile to use bonnie++ to test the speed of file creation and deletion. Out of curiosity I tested doing 2 million create/deletes, once on a linode VPS and another on a supermicro box with an LSI Megaraid with a 6 disk raid10 in it. Here is the VPS:

Version  1.96       ------Sequential Create------ --------Random Create--------
Linode VPS          -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
               1000 10650  34 152365  99   348   0 10856  35 180476  99   261   0
Latency              1468ms    9929us   13035ms    2528ms    2023us    9952ms

Supermicro+LSI:

Version  1.96       ------Sequential Create------ --------Random Create--------
LSI                 -Create-- --Read--- -Delete-- -Create-- --Read--- -Delete--
              files  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP  /sec %CP
               2000 18275  23 697591  99  1201   1 18436  23 842312  99  2356   3
Latency              1847ms     515us    9160ms    1519ms      85us    7116ms

Bonnie++ command:

# bonnie++ -u nobody -d . -c 10 -s 0 -r 0 -n 2000
share|improve this answer

Simfs is pseudo FS. Actually your files can be on anything ranging from EXT3 to you-name-it. My bet is EXT3 :) And it's very likely there're other processes (of other OpenVZ containers) I/O'ing on the same hard drive.

share|improve this answer

No, there is no general way of deleting that is faster than rm. The performance level you see isn't caused by OpenVZ per se, but is more likely caused by the OpenVZ host being overloaded. That is all too common for Virtuozzo-based hosting providers, because there aren't hard limits on any resource, they tend to be run with far too many customers on one server and performance suffers. That's why they're so cheap.

share|improve this answer
    
I believe my VPS isn't being oversold, as I stated other tasks are very fast. Physical machine is Intel Xeon X3430 4x2.4GHz with 8GB RAM shared across 4 users/servers and each user having their own dedicated HDD drive. –  Andrew Aug 21 '11 at 2:28
    
Have you verified that you're getting what you paid for? –  womble Aug 21 '11 at 2:30
    
Yes, I did verify the specifications as well as tried HDD test such as time dd if=/dev/zero bs=1024 count=10000000 of=/home/andy/10Gb.file which created 10GB file at 85.3 MB/s speed...And as I said other tasks are blazing fast, I really don't think they are overselling. I have this server for 2 months already and I really can't complain about anything but this slow rm -rf speed. –  Andrew Aug 21 '11 at 2:37
    
its all well and good having a dedicated HD, but you share a disk controller... so the bottleneck could well still be there, also its more than likely that your rm is going slow because of losing CPU time to one or more of the other 3 clients. rm -rf will be a challenge on simfs purely because it has to delete the file within yoru vps, but it has to delete it on the host node as well (not literally but it still has to process it) and when working with lots of files (like the HV will be) things take longer –  anthonysomerset Aug 21 '11 at 6:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.