Domain slowness issue

Today one of our domain was facing slowness issue. Domain response time is bit slow than earlier.

Here is the script to check the domain response time.
————-
[root@server02 ~]# cat /root/site_response.sh
#!/bin/bash

CURL=”/usr/bin/curl”
GAWK=”/usr/bin/gawk”
#echo -n “Please pass the url you want to measure: ”
read url
URL=”$url”
result=`$CURL -o /dev/null -s -w %{time_connect}:%{time_starttransfer}:%{time_total} $URL`
echo “Time_Connect — Time_start_transfer — Time_total ”
echo $result | $GAWK -F: ‘{ print $1″ “$2” “$3}’
————-

For checking the domain slowness we can put a php test page. Here it is “testdb.php”. After executing the script the domain is responding faster.

————-
[root@server02 ~]# for i in {1..15}; do echo “http://www.domain.com/testdb.php” | /root/site_response.sh; done
Time_Connect — Time_start_transfer — Time_total
0.339 0.484 0.488
Time_Connect — Time_start_transfer — Time_total
0.185 0.332 0.336
——————

Then you need to load the domain, this will load slowly.

———————
[root@server02 ~]# for i in {1..15}; do echo “http://www.domain.com/responses/contact/contact-success.html” | /root/site_response.sh; done
Time_Connect — Time_start_transfer — Time_total
0.185 63.641 63.779
Time_Connect — Time_start_transfer — Time_total
0.184 63.655 63.728
———————

Try to stop the CSF Firewall and load the domain this will be faster. Now you can see the domain is loading faster than earlier.

—————–
[root@server02 ~]# for i in {1..15}; do echo “http://www.domain.com/” | /root/site_response.sh; done
Time_Connect — Time_start_transfer — Time_total
0.189 0.515 0.669
Time_Connect — Time_start_transfer — Time_total
0.187 0.512 0.668
—————–

If you are experiencing the same issue we can conclude that there was some issues with the server firewall. So we need investigate why the domain is caught on firewall. Here we have checked the firewall logs in /var/log/messages. But we can’t see any IP address is blocked from the source server.

To see the IP address we need to enable inbound and outbound blocks logs in CSF firewall.

# vim /etc/csf/csf.conf

# Enable logging of dropped connections to blocked ports to syslog, usually
# /var/log/messages. This option needs to be enabled to use Port Scan Tracking

DROP_LOGGING = “1”
DROP_IP_LOGGING = “1”
DROP_OUT_LOGGING = “1”
———————->

After editing save and exit, also restart the CSF Firewall.

Then try to reload the domain and check the logs /var/log/messages. Then you can see the DST=69.58.188.42 IP address was blocked on CSF Firewall go and remove the IP adress from CSF.

Jul 23 22:43:01 lithium kernel: Firewall: *TCP_OUT Blocked* IN= OUT=eth0 SRC=72.34.59.62 DST=69.58.188.42 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=41190 DF PROTO=TCP SPT=59262 DPT=80 WINDOW=14600 RES=0x00 SYN URGP=0 UID=32359 GID=32361

For deleting IP address from CSF use this commands.

#csf -a 69.58.xx.xx
#csf -r

After restarting the CSF Firewall check the domain response time using script. Now we can see that the domain is loading much faster than earlier.

———————->
[root@server02 ~]# for i in {1..15}; do echo “http://www.domain.com/” | /root/site_response.sh; done
Time_Connect — Time_start_transfer — Time_total
0.189 0.515 0.669
Time_Connect — Time_start_transfer — Time_total
0.187 0.512 0.668
———————->

Advertisements

5 thoughts on “Domain slowness issue

  1. Hi there very nice website!! Guy .. Beautiful ..
    Amazing .. I’ll bookmark your website and take the
    feeds also? I’m satisfied to search out a lot of useful info right here
    within the put up, we need work out more techniques on this regard, thank
    you for sharing. . . . . .

  2. Outstanding post however , Ӏ waѕ wondering if yοu could write а litte more
    on thіs subject? І’d be ѵery grateful if
    yօu coսld elaborate a lіttle bit furtheг. Тhank yοu!

  3. Very nice post. I just stumbled upon your blog and wished to say that I hace truly enjoyed surfing around your blog posts.
    After all I’ll be subscribing to your feed and I hope you
    write again soon!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s