perl dbi - limit cpu and memory usage
Posted on 2008-10-21
Hi, I have a Perl script that using DBI (DBD::CSV) to read a CSV file via a SELECT * to and convert it to a Excel file. Script is run on Windows 2003 server.
The script works correctly, but the Perl process and the Excel (via OLE) subprocess eat up ~100% of the CPU usage and a large amount of memory. The CSV files are ~30MBs.
Is there a way to limit the CPU usage for the script? Or at a lower level (e.g. at the DBI level)?
Might be nice to limit how much memory the process uses too, but this it not as important as limiting the percent of CPU usage.
And I have thought about using the SQL LIMIT syntax and putting in wait steps which I believe would work, but I was hoping there was an easier way to handle this rather than complicating the program.