Gossamer Forum
Home : General : Perl Programming :

script timing out

Quote Reply
script timing out
i'm having problem sending emails to entire database of only 100 records from dbman. it times out after only about 50 records. this is what webhost says:


They are using CGI script that is trying to allocate too much memory.
We enforce extremely generous 50 MB memory limit per CGI process
instance. It looks like the script tries to load the entire database of
records into memory. It is a common programming error. It is also
possible that their record set had recently grown to the size and this
bug had manifested itself in this way. A much better way to write code
is to open db file and start processing records in it one at a time.

My recommendation is to find a better written list management CGI or fix
existing code.

FYI: They have a 50 MB sized core file inside cgi/db-private/ directory.
This is a clear indication that their "db.cgi" attempted to exceed that
memory limit.
i know nothing about sql or mysql etc. i've learned what little i know about perl from hacking dbman extensively. what should i do?
Quote Reply
Re: [delicia] script timing out In reply to
Mmm, so there are only 100 records you are trying to grab? It shouldn't be using 50mb of memory just for that. Actually, is this the flat-file version (not SQL) ? How large is your database file itself? (afraid I don't know where it is, as I dohn't work with DBMan)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] script timing out In reply to
yes it is flatfile version. the db file is only 24k. i've customized the script so much i have broken down db.cgi into several files. the total size is about 330k and the html file is 70k.
Quote Reply
Re: [delicia] script timing out In reply to
Mmm, sounds like you have a memory leak somewhere, as that shouldn't be getting anywhere near 50mb in process size :/

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] script timing out In reply to
how do i look for memory leak? i would love to find a way to print all my variables at any spot so i can see what's there. i guess that's what you mean by leak?
Quote Reply
Re: [delicia] script timing out In reply to
Unfortunatly memory leaks are a sod to find :(

Normally, they can be from when you have a large variable, and don't "remove" it after using it.

Have you considered using DBMan SQL ? It will be a LOT more friendly in terms of processing time atm, and is also customizable without editing the "core" files

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] script timing out In reply to
i am considering dbman sql. problem is i don't know ANYTHING about sql so i would have to start over learning. there's so little activity in that section of this forum i was afraid the product wasn't much used and maybe not good. however, if YOU recommend it, i would probably consider more! is it enough like dbman original that i could learn it pretty quick?

thought i would play with use strict & use warnings but script crashed quickly (error 500) but no useful message.

Last edited by:

delicia: Jan 14, 2010, 8:40 AM
Quote Reply
Re: [delicia] script timing out In reply to
Hi,

Yeah, its pretty similar (its more like GLinks) ... by very intuative interface, and should be pretty easy to pick up :) I have worked with it in the past, and have never had any problems with it (you will also notice a major speed difference, especially once you start getting more data in it)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] script timing out In reply to
i'm using htaccess with dbman; would that be a problem? here's my directory structure:
Code:
cgi --
------- dbpublic contains all db programs and files, incl db.cgi; includes .pass files for permissions
------- dbprivate contains only htaccess and db.cgi; this db.cgi references all the files in dbpublic

db.cgi in both directories:
requires the pl files in dbpublic that include all the subroutines
ends right before sub main {

public links go to dbpublic directory; private links for our members go to dbprivate so they have to login thru htaccess to make changes; only one login required

does this sound like it would work?
Quote Reply
Re: [delicia] script timing out In reply to
Hi,

Not really sure - but may be worth contacting sales@gossamer-threads.com, and I'm sure they'd be able to tell you if thats possible :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] script timing out In reply to
thanks, i've emailed them and hope to get a reply soon. btw, are you in scotland? my favorite country after USA.
Quote Reply
Re: [delicia] script timing out In reply to
Hi,

NP =)

Nah, I'm not in Scotland (just don't like putting my full address on forums =)). I'm down south in England, about 50 miles from London.

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package (plugins total "value" $3,325 & rising, for just $350)| GLinks ULTRA Package PRO (plugins total "value" $5,625 & rising, for just $500)
Support Forum | Links SQL Plugins | DMOZ Dumps | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Compare our different Plugin packages *new* Free CSS Templates
Quote Reply
Re: [Andy] script timing out In reply to
ok. just saw the google map on your profile