Welcome to WebmasterWorld Guest from 54.145.246.183

Forum Moderators: coopster & jatar k & phranque

Can badly behaved scripts cause widespread problems

I'm having trouble with my host.

   
9:44 am on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



I only use form mail and counters on my site. From time to time (and several times in the last few days) my counter files have dropped to zero-length. Bizarrely, at one point, my site was wholly invisible to Firefox (but could be seen by IE - both caches having been cleared). Also, I am often unable to access my email and emails sent out may not actually be despatched for up to 24 hours.

So much for the symptoms. My question is this. Could these faults be caused by bugs in my scripts? My feeling is the answer is "no", but before I through a major wobbly with my host, I thought I would ask for expert opinions here first.

NOTE: I wrote both counter and form-mail scripts myself.

Kaled.

2:41 pm on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Are you using mod_perl? Is your formmailer synchronous (e.g., sends the mail immediately and waits for an answer from the mailserver) or does it put the mail into some queue with zero waiting?

How is the counter embedded in the HTML? Does the page generator wait until the counter has incremented its count in the DB? If the content gets cached, this could lead to 0 bytes sent to the browser until the counter has finished.

IMO it *could* be some misbehaving CGIs that result in a kind of DOS attack.

6:41 pm on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Or your server disk space could be full, or at least the part alotted to your domain or the virtual domain directory. This would cause any of the above symptoms. A file get opened for writing, it attempts to write to it, system says full disk, it closes it flushed. I've been "fortunate" :-) enough to encounter this many times. More often than not it's on a limited-space domain and the cuplrit is per-domain usage logs.
11:16 pm on Dec 27, 2004 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks for the suggestions. To answer questions

1) Using standard Perl only (not mod_perl).
2) Using smtp module (rather than SendMail).
3) Using javascript to include counters in html (I've been thinking of changing this).
4) All counters disable caching.
5) Checked log files - one has been zeroed recently : very interesting!

Kaled.

PS How to I check the length of a file. My counters are self-repairing except if a zero-length file exists - DRAT!

1:51 am on Dec 28, 2004 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



@stat = stat("$your_file");
if (! ($stat[7]>0)) { print "Empty file!"; }

Look up stat, it's a 12 item array with lots of info about a file, including lastmod and other goodies, it's good to get in the habit of using it. If all you want is size

$f_size = -s "$your_file";
if (! ($f_size > 0)) { print "It's still empty!"; }

10:13 am on Dec 28, 2004 (gmt 0)

WebmasterWorld Senior Member kaled is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Thanks... I'm away from home but I'll add this fix in the New Year.

Kaled.

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month