Forum Moderators: coopster

Message Too Old, No Replies

site hangs for 2.33 minutes every hour

performance, hangs, x-cart,

         

stephenjen

3:50 pm on Jul 4, 2008 (gmt 0)

10+ Year Member



I have installed a php shopping cart, x-cart. Performance of the site is normally acceptable, but I started to notice that it would hang for couple minutes every so often.

I ran WebLoad to capture benchmarking data and noticed that the site hangs for 2.333 minutes straight every hour, and the pattern held for 5 hours.

The setup is LAMP, and we operate 2 other sites on the server, and no problems with the other sites.

Any pointers would be greatly appreciated!

siMKin

7:55 am on Jul 5, 2008 (gmt 0)

10+ Year Member



have a look in the web-logs for supicious activity and also check if there are any cronjobs active

vincevincevince

8:04 am on Jul 5, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Sounds like a cron job, possibly doing one of the following:
  • Restarting webserver
  • Backing up files or database (disables webserver as simple locking)
  • Rebooting(!)
  • siMKin

    9:30 am on Jul 5, 2008 (gmt 0)

    10+ Year Member



    #Restarting webserver and #Rebooting(!) are not very likely since the other website don't experience problems.

    if you have shell access the "top" command is also very usefull in these cases. see for example:

    [linuxforums.org...]

    henry0

    11:33 am on Jul 5, 2008 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    siMKin
    vincevincevince could be correct
    depending on what you have ownership on
    for ex: I run a few sites on a dedicated server
    and restart Apache on a per site basic.

    stephenjen

    3:59 pm on Jul 5, 2008 (gmt 0)

    10+ Year Member



    I have looked at the cron job log and also executed top. Nothing suspicious with those two. There's also no job setup to backup the db and my dedicated server is not setup where I can shut down apache on a per vhost basis

    One thing that I tried last night - I reverted back to the vanilla version of x-cart, i.e., no changes from when the source and the database was delivered to me, and it ran fine with webload for 4 hours. Then I ran webload again with changed code but paired up with the vanilla database schema. Fully expecting it to crash/hang every hour, it didn't....

    So it seems to be with the database?

    I'm under the belief that only minor changes were made to the database, like a new field here and there. What would cause the db to act up every hour?

    stephenjen

    11:11 pm on Jul 5, 2008 (gmt 0)

    10+ Year Member



    It's strange. i did a diff between the db i modified and the original db that came with x-cart. One table has a different structure.

    The first is from the schema i modified:
    CREATE TABLE `xcart_languages` (
    `code` char(2) collate latin1_general_ci NOT NULL default '',
    `name` varchar(128) collate latin1_general_ci NOT NULL default '',
    `value` text collate latin1_general_ci NOT NULL,
    `topic` varchar(24) collate latin1_general_ci NOT NULL default '',
    PRIMARY KEY (`code`,`name`),
    KEY `topic` (`topic`)
    ) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_general_ci;

    This is from the original schema:
    CREATE TABLE `xcart_languages` (
    `code` char(2) NOT NULL default '',
    `name` varchar(128) NOT NULL default '',
    `value` text NOT NULL,
    `topic` varchar(24) NOT NULL default '',
    PRIMARY KEY (`code`,`name`),
    KEY `topic` (`topic`)
    ) ENGINE=MyISAM DEFAULT CHARSET=utf8;

    I didn't change this table except to insert additional values via phpmyadmin. This table is used all over the place and reverting the structure back resolved my issue. why it caused my site to run slow the last three minutes of every hour remains unknown to me...

    vincevincevince

    5:00 am on Jul 6, 2008 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    It could well be a locking issue; you could try making it InnoDB rather than MyISAM

    henry0

    10:53 am on Jul 6, 2008 (gmt 0)

    WebmasterWorld Senior Member 10+ Year Member



    x-cart is not free, if I remember correctly it comes with a pretty good support system and I would imagine a decent users forum
    Have you tried to contact them?

    stephenjen

    11:29 pm on Jul 6, 2008 (gmt 0)

    10+ Year Member



    I've been testing the site and changing that one table seem to have done the trick.

    I have been posting to the x-cart forum with no luck. Also submitted a ticket on it's help desk without any response.

    Just glad this is behind me, and the site can officially launch tomorrow.

    Thanks for the input.

    eelixduppy

    3:11 am on Jul 7, 2008 (gmt 0)



    Glad you were able to resolve your issue. It still doesn't entirely make sense but now that's it's fixed I guess it doesn't matter any longer. Keep us posted if you find out anything new.

    Oh, and Welcome to WebmasterWorld! :)