Perl slowness

Perl slowness

Noam Rathaus noamr at beyondsecurity.com
Tue Sep 8 17:49:20 IDT 2009


Hi,

Here you go...

--- old    2009-09-08 17:47:41.000000000 +0300
+++ new    2009-09-08 17:47:31.000000000 +0300
@@ -1,38 +1,45 @@
-tune2fs 1.40-WIP (14-Nov-2006)
-Filesystem volume name:   /
+tune2fs 1.41.3 (12-Oct-2008)
+Filesystem volume name:   <none>
 Last mounted on:          <not available>
-Filesystem UUID:          5a1d4aa2-a4e8-48a5-b80d-03dbcebb2a4c
+Filesystem UUID:          466838ce-735c-4523-9941-ecab400e22c4
 Filesystem magic number:  0xEF53
 Filesystem revision #:    1 (dynamic)
-Filesystem features:      has_journal filetype needs_recovery sparse_super
-Filesystem flags:         signed directory hash
+Filesystem features:      has_journal ext_attr resize_inode dir_index
filetype needs_recovery sparse_super large_file
+Filesystem flags:         signed_directory_hash
 Default mount options:    (none)
 Filesystem state:         clean
 Errors behavior:          Continue
 Filesystem OS type:       Linux
-Inode count:              9584640
-Block count:              19153488
-Reserved block count:     957674
-Free blocks:              16844413
-Free inodes:              9328387
+Inode count:              9601024
+Block count:              38399358
+Reserved block count:     1919967
+Free blocks:              37358729
+Free inodes:              9551984
 First block:              0
 Block size:               4096
 Fragment size:            4096
+Reserved GDT blocks:      1014
 Blocks per group:         32768
 Fragments per group:      32768
-Inodes per group:         16384
+Inodes per group:         8192
 Inode blocks per group:   512
-Last mount time:          Sun Jun 14 14:00:14 2009
-Last write time:          Sun Jun 14 14:00:14 2009
-Mount count:              17
-Maximum mount count:      30
-Last checked:             Sun Jan 20 17:04:43 2008
-Check interval:           0 (<none>)
+Filesystem created:       Wed Aug 12 14:18:23 2009
+Last mount time:          Tue Sep  8 09:08:05 2009
+Last write time:          Tue Sep  8 09:08:05 2009
+Mount count:              3
+Maximum mount count:      20
+Last checked:             Fri Sep  4 18:46:20 2009
+Check interval:           15552000 (6 months)
+Next check after:         Wed Mar  3 17:46:20 2010
 Reserved blocks uid:      0 (user root)
 Reserved blocks gid:      0 (group root)
 First inode:              11
-Inode size:          128
+Inode size:              256
+Required extra isize:     28
+Desired extra isize:      28
 Journal inode:            8
-First orphan inode:       2097564
+First orphan inode:       3777224
+Default directory hash:   half_md4
+Directory Hash Seed:      8998eea4-7d31-437f-bf0b-a12c3dc853ab
 Journal backup:           inode blocks


2009/9/8 Arie Skliarouk <skliarie at gmail.com>

> Hi,
>
> Interesting riddle...
>
> 2009/9/8 Noam Rathaus <noamr at beyondsecurity.com>
>
>> The most notable difference is the read time on files (new HD)
>> 0.047210 read(7, " <= 0)\n {\n  $numLimit = 10;\n }\n\n "..., 4096)
>>
>> Instead of (old HW)
>> 0.001462 read(6, "owItem = $1;\n\n my $RowItems = $s"..., 4096) = 4096
>>
>> That is 40 times slower (it is the same file being opened)
>>
>
> What is the filesystem used on the machines? Do they have similar mount
> flags (no_atime or such)?
> If both are ext2/3, compare "tune2fs -l /dev/sda1" on them.
> Try to mount both filesystems using noatime and compare timings then.
>
> Full disk might affect fragmentation or placement of the files and thus
> require long seeks. As atime needs to be updated (or journal log), buffering
> in memory would not help.
> Test write speed of the disks.
>
> --
> Arie
>
>>
>> I have no idea why there is such a difference
>>
>> hdparm on the old:
>> hdparm -t /dev/sda
>>
>> /dev/sda:
>>  Timing buffered disk reads:  190 MB in  3.02 seconds =  62.87 MB/sec
>>
>> hdparm on the new:
>> # hdparm -t /dev/sda
>>
>> /dev/sda:
>>  Timing buffered disk reads:  314 MB in  3.01 seconds = 104.22 MB/sec
>>
>> On Tue, Sep 8, 2009 at 3:02 PM, Noam Meltzer <tsnoam at gmail.com> wrote:
>>
>>> Did you try to check with strace ?
>>>
>>> 2009/9/8 Noam Rathaus <noamr at beyondsecurity.com>
>>>
>>>> Hi,
>>>>
>>>>
>>>> I have two machines, their hardware is not identical, but their
>>>> installation is.
>>>>
>>>> One is a 3 years old DELL server, while the other is a 1 year old
>>>> server.
>>>>
>>>> One is running 2.6.26-2-686 while the other 2.6.30-1-686
>>>>
>>>> What I am seeing is slow startup - emphasis on startup, the code works
>>>> fast once its running - of perl scripts
>>>>
>>>> Even the smallest perl script such as this:
>>>> ===
>>>> #!/usr/bin/perl
>>>>
>>>> use lib '/usr/local/MySystem/lib';
>>>>
>>>> use DB;
>>>>
>>>> ===
>>>>
>>>> Take 7 seconds to start, in comparison to 0.030secods
>>>>
>>>> If I don't use the "use DB;" which my package
>>>>
>>>> It loads fast
>>>>
>>>> I am trying to figure out why, I checked the HD speeds via hdparam, the
>>>> newer server is 1.5 times faster 103MB/sec
>>>>
>>>> I tried to see what libraries were being used, used strace, but I can't
>>>> see something "big" that is causing the delay.
>>>>
>>>> The "use DB;" can be replaced with any other "custom" library package I
>>>> wrote, they all take 2-7 seconds to load, while on the other machine it
>>>> takes negligible time
>>>>
>>>> Does someone have a "thread" to cling to?
>>>>
>>>> Thanks,
>>>> Noam Rathaus
>>>>
>>>> _______________________________________________
>>>> Linux-il mailing list
>>>> Linux-il at cs.huji.ac.il
>>>> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>>>>
>>>>
>>>
>>
>> _______________________________________________
>> Linux-il mailing list
>> Linux-il at cs.huji.ac.il
>> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>>
>>
>
> _______________________________________________
> Linux-il mailing list
> Linux-il at cs.huji.ac.il
> http://mailman.cs.huji.ac.il/mailman/listinfo/linux-il
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.cs.huji.ac.il/pipermail/linux-il/attachments/20090908/65ec7766/attachment-0001.html>


More information about the Linux-il mailing list