store | blogs | forums | twitter | facebook | wiki | mailing lists | downloads | support portal
Atomic Secure Linux
It is currently Tue May 21, 2013 4:17 pm

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]




Post new topic Reply to topic Share/Bookmark  [ 4 posts ] 
Author Message
 Post subject: Bad PHP or a mod_sec rule?
Unread postPosted: Mon Jun 20, 2011 12:28 pm 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 1846
One of our customers is having problems with a particular page loading really really slowly (10 seconds-ish). I'm trying to figure out if it is a problem with the PHP code or possibly a mod_sec issue.

Basically the page does a MySQL lookup and then generates a calendar in html on the page, with each day number having a hyperlink with an argument (e.g. page.php?something=this/that/theother )

I've used top, and see that mysql goes to 6% CPU but http hits 97% and stays there for a good 10 seconds while the page refreshes.

As far as I'm aware, mod_sec isn't going to be in play at this point, so it is most likely poorly written or at least poorly optimised PHP (I don't think it will be MySQL due to low CPU use on it and there are no "slow queries" reported)

Am I right about this, or could mod_sec have a hand in this somewhere? I suppose the hidden iframe rule will have scanned the page, but is there anything else in the asl rules that look at the rendered page as opposed to checking posts/gets?

Faris.

p.s. memory use by http and mysql as reported by top during the page load is not significant (e.g. 4%).

_________________
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>


Top
 Profile  
 
 Post subject: Re: Bad PHP or a mod_sec rule?
Unread postPosted: Mon Jun 20, 2011 1:07 pm 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Sat Aug 20, 2005 9:30 am
Posts: 2812
Location: The Netherlands
I have never seen mod_security make a page load slowly, but you could just temporarily disable mod_security for this directory/vhost/server if you want to check if it makes a difference.

_________________
Lemonbit Internet Dedicated Server Management


Top
 Profile  
 
 Post subject: Re: Bad PHP or a mod_sec rule?
Unread postPosted: Mon Jun 20, 2011 2:52 pm 
Offline
Atomicorp Staff - Site Admin
Atomicorp Staff - Site Admin

Joined: Wed Dec 31, 1969 8:00 pm
Posts: 7424
Location: earth
Are any mod_rewrite rules involved? That could certainly manifest like that


Top
 Profile  
 
 Post subject: Re: Bad PHP or a mod_sec rule?
Unread postPosted: Tue Jun 21, 2011 7:57 am 
Offline
Long Time Forum Regular
Long Time Forum Regular

Joined: Thu Dec 09, 2004 11:19 am
Posts: 1846
No, no mod_rewrite rules at all.

I'll try disabling mod_sec for that directory and see what happens.

Faris.

_________________
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic Share/Bookmark  [ 4 posts ] 

» Feed - Atomicorp

All times are UTC - 5 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group