df4or has asked for the wisdom of the Perl Monks concerning the following question:
I understand that our problem might not(only|at all) be related to Perl, but since this is the language of choice and I know there is a lot of wisdom to be found here, I beg to ask...
When migrating several older Perl programs from an old to a new server we saw a dramatic decrease in execution speed, although the newer machine should be much faster.
Old machine:
Intel Celeron @2.2GHz, 4533 bogomips, 2GB RAM, Perl 5.10.1, Ubuntu 10.04 LTS, kernel 2.6.32-45, mysql 14.14 Distrib 5.1.66, SysV init
New machine:
Intel Core i3-4160 @3.6GHz, 7200 bogomips, 8GB RAM, Perl 5.20.2, Debian jessie, kernel 3.16.0-4, mysql 15.1 Distrib 10.0.23-MariaDB, systemd 215
The difference in one task was about 10-fold (i.e. the script took more than 10 times as long to run on the new machine, 0m58 vs. 11m). In another case the slow down was about 4 to 8-fold. Measurements were taken with the 'time' command on the command line.
The slowest program reads a dBase database table sequentially, mangles the data a bit and writes the records to a text and to a MariaDB SQL table. When commenting out the only $sth->execute statement the execution time jumps up from 11 minutes to 38 seconds. Some careful performance tuning on the MySQL/MariaDB server brought the execution time down to 2m40 (from 11m), still about 3 times slower than the old machine.
Another program, which does not use SQL, reads a dBase file, mangles the data a bit and writes them to a text file. Here the slowdown is about 4-fold. Some analysis with Devel::NYTProf found that most time is spent in IO::Handle which in turn is called by XBase.pm.
What I did and concluded so far:
My question:
What else could be the reason for the slowdown? Is there anything which makes Perl 5.20 so much slower at IO handling? Is there anything obvious that I am missing, maybe something affecting IO in general? Buffering?
Any help is highly appreciated.
Thanks in advance,
Ekki
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Much slower execution from one machine to another
by graff (Chancellor) on Jun 03, 2016 at 22:56 UTC | |
|
Re: Much slower execution from one machine to another
by BrowserUk (Patriarch) on Jun 03, 2016 at 17:52 UTC | |
|
Re: Much slower execution from one machine to another
by Laurent_R (Canon) on Jun 03, 2016 at 17:37 UTC | |
|
Re: Much slower execution from one machine to another
by rdfield (Priest) on Jun 05, 2016 at 13:28 UTC | |
|
Re: Much slower execution from one machine to another
by anonymized user 468275 (Curate) on Jun 05, 2016 at 15:00 UTC |