Very slow


#1

Hello,

I’m very impressed with DH’s features after just having moved across, the way it’s so configurable is great. But I got a nasty shock when I started running my scripts and found they were taking hundreds of times longer than they do on my development server, or my previous server.

The main reason is, I think, because mysql is on machine separate to the web server, and the pings times to and from is ~5ms. In a heavily DB reliable script 5ms/query adds up very quickly.

I expect this has come up before, does anyone have any suggestions about what to do? I’ve enabled client compression, but it hasn’t made any real difference.

Regards,
Kestas


#2

It seems that now the load average has come down it has sped up quite a bit, which is promising.
But I’ve been monitoring with top, and it didn’t seem like much was going on before that isn’t going on now. Why has the load average dropped? If I knew this I’d know how often to expect it to happen


#3

Weird, one script that only does 5 select queries and 3 insert queries can sometimes take 0.07secs, and sometimes 0.54secs, and everything in between.
It does seem to correspond to load average, but what is causing load average to fluctuate so much?

The scripts don’t use the disk at all, there’s plenty of free memory (1GB) and idle CPU time (~70%), the bottleneck should only be the mysql database. :confused:


#4

If you find that your MySQL server is having load problems, then just ask support to move your database(s) onto a different server. You’re allowed to do that. :slight_smile:

emufarmers.com
Very little to do with either emus or farmers!


#5

Hmm it’s just that I don’t think this is a MySQL server problem. The load averages have been really high.

One thing I noticed is that when I do netstat -at | grep phpdip (part of my sites name), it comes up with 300 connections to the mysql server!
I’m not using persistant connections, I’m using PHP’s mysql_connect(). I wasn’t mysql_close()ing the connections because that should be done automatically.
I added mysql_close() to the end of the script, and now it’s down to ~25 connections open. But there’s still only about 10 users online at any given time.

And it also doesn’t explain why the connections weren’t closing before, they should close automatically at the end of a script’s execution.
I hope this is what was causing the high loads though, the load average does seem to have gone down.


#6

Interesting 3-part series on load measuring and testing, and pdf presentation.

http://www.perfdynamics.com/CMG/CMGslides4up.pdf

“If long term trends indicate increasing figures, more or
faster CPUs will eventually be necessary unless load can be
displaced. For ideal utilization of your CPU, the maximum
value here should be equal to the number of CPUs in the
box.”


$1 for me << [color=#00CC00]SE7ENOF9[/color] | [color=#CC0000]SE7ENOF97[/color] >> All for you


#7

The load average went back up again, but I noticed something “strange”:

http://phpdiplomacy.net/wthigo.txt
That’s the output of netstat -at , and ~95% of it is smtp connections to external hosts.

Also looking at ps I notice:
maosposo 22018 0.7 0.1 5980 4352 ? S 00:21 1:02 /usr/bin/perl dm.cgi
maosposo 22019 0.1 0.1 6168 4612 ? S 00:21 0:11 /usr/bin/perl dm.cgi
maosposo 22020 0.1 0.1 6164 4612 ? S 00:21 0:11 /usr/bin/perl dm.cgi
maosposo 22021 0.1 0.1 6168 4612 ? S 00:21 0:11 /usr/bin/perl dm.cgi
maosposo 22022 0.1 0.1 6168 4612 ? D 00:21 0:11 /usr/bin/perl dm.cgi
maosposo 22023 0.1 0.1 6288 4616 ? S 00:21 0:11 /usr/bin/perl dm.cgi
maosposo 22024 0.1 0.1 6164 4612 ? S 00:21 0:11 /usr/bin/perl dm.cgi
maosposo 22025 0.1 0.1 6168 4612 ? S 00:21 0:11 /usr/bin/perl dm.cgi
(etc, etc)

Loads of these perl scripts are running constantly, and when I google dm.cgi I get the feeling it’s a malicious script. Maybe this script is spamming?
It’s hard to think of a good reason to connect to thousands of smtp servers at once for extended periods of time…

Who should I speak to about this?

edit: Now that this has stopped the load average has plummeted to ~0.3 from ~7 , I’d really like to see this script removed


#8

[quote]"…For ideal utilization of your CPU, the maximum
value here should be equal to the number of CPUs in the
box."[/quote]
Remember, DreamHost uses NFS and, as I understand it, pending file related processes can artificially inflate the load figures.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#9

I suggest you contact DreamHost support via the panel and tell them what you discovered. If there is someone spamming from one of their servers, you can bet they will want to know about it.

Mark


Save [color=#CC0000]$50[/color] on DreamHost plans using [color=#CC0000]PRICESLASH[/color] promo code (Click for DreamHost promo code details)


#10

Official Support in panel.


$1 for me << [color=#00CC00]SE7ENOF9[/color] | [color=#CC0000]SE7ENOF97[/color] >> All for you


#11

Not sure how related this is but my site is taking 15-45 seconds just to go from one page to another. It’s not only my site but it’s DH as well. Very long delays moving around in the control panel. I have surfed many other sites today and the last few days with no problems.

Speed was a big issue as to why I moved from my old host, they were a bit slow, servers in CA, but no where near as slow as this.

Unfortunently I may have to request a refund for the year I paid for here and move on but I’ll give it a few weeks before I do that.