Hey gang,
I've got my site on a virtual dedicated server. My provider's "support" isn't that hot unless I pay $150/hr labor, so that's out. My basic problem is that the web server is experiencing bottlenecks. They say it's memory (I'm only guaranteed 256MB). So, before I just throw money at the problem and go fully dedicated (which I will likely have to do) I would like to make it as lean as possible
I have a script that uses Net::POP3 that logs into the pop server, downloads the list, checks the uidl's against a list of previously read uidls (stored in a DB) and if it's not in there, it parses it. Basic idea is:
my $pop = Net::POP3->new( $server, Debug => 0 ) || die $!;
if ( $pop->login( $u_name, $p_word ) > 0 ) {
my $msgnums = $pop->list() || die $!;
foreach my $msgnum ( sort keys %$msgnums ) {
my $uidl = $pop->uidl( $msgnum );
## Check if message was previously read
## If not, read, parse, and move on
}
}
As I have a few hundred messages on the server at any time, this seems to be a pretty massive waste of resources (it runs several times an hour). Is there any way w/ Net::POP3 to keep it open, and just have it listen like a socket so I can just let the script run like a daemon?
I see the last() function, but that doesn't seem to guarantee I'll get every message.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.