Apache slow to respond

Moderator: crythias

Post Reply
lucasdgr
Znuny newbie
Posts: 31
Joined: 24 Sep 2010, 14:16
Znuny Version: 2.4

Apache slow to respond

Post by lucasdgr »

I have CentOS 5.5 x86_64 with Apache, php and mysql.
I notice that is slow to respond and at times unresponsive.
OTRS I have only installed on that server and no users. I'm currently configuring.
I have a 2Ghz processor, 1GB memory (2GB recommended).
Previously I've used it with 1GB but it worked perfectly.

The Support Assessment says next to highlight:

Code: Select all

.....
OS
Check 	Comentario 	Estado
A CPU load check. We try to find out if the system load in the last 15 minutes < 1.
	The Host System has a load: 0.30 in the last 1 minute 5.51 in the last 5 minutes 6.34 in the last 15 minutes 	Failed
.....
Webserver
Check 	Comentario 	Estado
Check if the system uses Apache::DBI.
	Apache::DBI should be used to get a better performance (pre-establish database connections). 	Critical

Top says

Code: Select all

17692 apache    19   0  379m  83m 4196 R  8.5  8.4   0:07.43 httpd
17725 apache    25   0  381m  86m 4404 R  5.9  8.6   0:02.97 httpd
 2322 mysql     15   0  325m  51m 2876 S  3.6  5.1   4:33.37 mysqld
17727 apache    25   0  375m  80m 4332 R  3.6  8.0   0:04.62 httpd
17691 apache    25   0  435m 138m 4500 R  3.3 13.9   0:09.95 httpd
17695 apache    25   0  382m  84m 4408 R  3.3  8.5   0:04.00 httpd
17698 apache    25   0  391m  92m 4572 R  3.3  9.3   0:06.46 httpd
17724 apache    25   0  481m 186m 4404 R  3.3 18.6   0:07.72 httpd
17863 apache    25   0  358m  68m 3168 R  3.3  6.9   0:01.62 httpd
17858 apache    25   0  358m  68m 3168 R  2.6  6.9   0:01.74 httpd
17864 root      15   0 12712 1040  808 R  0.3  0.1   0:00.29 top
    1 root      18   0 10352  616  564 S  0.0  0.1   0:10.14 init
I suspect the problem is Apache and MYSQL

Anybody can help me?

Thanks.
OTRS 2.4.8 - ITSM 2.1.1 - FAQ 1.6.5
Server CentOS-5.5-x86_64
Apache 2.2.3 - Mysql 5.0.77 - perl v5.8.8
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Apache slow to respond

Post by Wolfgangf »

you should have a look at your <OTRS_HOME>/scripts/apache2-perl-startup.pl
and uncomment to following lines

Code: Select all

use Apache::DBI ();
Apache::DBI->connect_on_init('DBI:mysql:otrs', 'otrs', '<password>');
use DBI ();

# enable this if you use mysql
use DBD::mysql ();
use Kernel::System::DB::mysql;
assuming that <OTRS_HOME>/scripts/apache2-perl-startup.pl is used in your webservers config /etc/apache2/otrs.conf
make sure the Apache::DBI module is installed
and then restart apache by

Code: Select all

apache2ctl restart
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
lucasdgr
Znuny newbie
Posts: 31
Joined: 24 Sep 2010, 14:16
Znuny Version: 2.4

Re: Apache slow to respond

Post by lucasdgr »

thanks for responding Wolfgangf.
follow your recommendations, but at times is slow to respond.
Now [Support Assessment] reads me

Code: Select all

Webserver
Check 	Comentario 	Estado
Display web server version. You are running Apache/2.2.3 (CentOS). 	OK
Check for CGI Accelerator. You should use FastCGI or mod_perl to increase your performance. 	[b]Critical[/b]
Note that no message appears:

Code: Select all

Check if the system uses Apache::DBI.  Apache::DBI should be used to get a better performance (pre-establish database connections).Critical
Here is a new capture process status

Code: Select all

 2615 otrs      25   0  110m  30m 2884 R  3.6  3.0   0:00.79 GenericAgent.pl
 2616 otrs      25   0 67112  23m 1836 R  2.5  2.3   0:00.65 PostMasterMailb
 2617 apache    25   0 45356 9.9m 1736 R  1.9  1.0   0:00.30 index.pl
 2502 apache    18   0  242m 7360 1336 S  0.4  0.7   0:00.11 httpd
 2337 mysql     15   0  246m  55m 4132 S  0.3  5.5   0:05.35 mysqld
 2595 root      15   0 12716 1036  808 R  0.3  0.1   0:00.82 top
    7 root      10  -5     0    0    0 S  0.2  0.0   0:00.03 events/1
 2555 root      15   0 88060 3316 2600 S  0.1  0.3   0:00.38 sshd
 2409 root      18   0  242m  11m 5916 S  0.1  1.2   0:01.13 httpd
    1 root      18   0 10352  700  588 S  0.0  0.1   0:00.73 init
OTRS is critical to work with 1GB of memory?
Right now I have no operators need no customers using the system.
I hope to fix this.
I appreciate your help...
OTRS 2.4.8 - ITSM 2.1.1 - FAQ 1.6.5
Server CentOS-5.5-x86_64
Apache 2.2.3 - Mysql 5.0.77 - perl v5.8.8
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Apache slow to respond

Post by Wolfgangf »

Hold on a second:
- you checked which startup script apache is using (check /etc/apache2/etc/conf.d/otrs.conf)
- assuming apache2-perl-startup.pl:
- you uncommented the lines below
- you restarted apache and checked the error_log and it's clear
- and a new support assesement shows again the same: ... Check for CGI Accelerator ....

so definitelly something went wrong with the procedure above

- wrong startup file
- apache::dbi not installed
- ...
Please check the logfiles of apache and otrs log
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
Mike_B
Moderator
Posts: 266
Joined: 12 Jan 2010, 18:16
Znuny Version: CVS HEAD

Re: Apache slow to respond

Post by Mike_B »

lucasdgr wrote:

Code: Select all

Webserver
Check 	Comentario 	Estado
Display web server version. You are running Apache/2.2.3 (CentOS). 	OK
Check for CGI Accelerator. You should use FastCGI or mod_perl to increase your performance. 	[b]Critical[/b]
[/code]
That's your biggest issue I guess, you should really use mod_perl. Simply install it from your package manager.


That said, Apache/2.2.3 is very old. I understand Centos 5 still ships with it, but if I'd have the say I'd go for some linux distribution with a more modern Apache (maybe Ubuntu LTS 10.04 or Debian). This will however not be a very big performance boost.
huntingbears.nl - @michielbeijen on Twitter
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Apache slow to respond

Post by Wolfgangf »

Mike_B wrote:
That's your biggest issue I guess, you should really use mod_perl. Simply install it from your package manager.
You are right - I overlooked that and assumed mod_perl is already installed, that's why i focused on Apache::DBI
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
lucasdgr
Znuny newbie
Posts: 31
Joined: 24 Sep 2010, 14:16
Znuny Version: 2.4

Re: Apache slow to respond

Post by lucasdgr »

thanks for your help.

the /etc/httpd/conf.d/otrs.conf is as follows

Code: Select all

# --
# added for OTRS (http://otrs.org/)
# $Id: apache2-httpd-new.include.conf,v 1.5 2008/11/10 11:08:55 ub Exp $
# --

# agent, admin and customer frontend
ScriptAlias /otrs/ "/opt/otrs/bin/cgi-bin/"
Alias /otrs-web/ "/opt/otrs/var/httpd/htdocs/"

# if mod_perl is used
<IfModule mod_perl.c>

    # load all otrs modules
    Perlrequire /opt/otrs/scripts/apache2-perl-startup.pl

    # Apache::Reload - Reload Perl Modules when Changed on Disk
    PerlModule Apache2::Reload
    PerlInitHandler Apache2::Reload
    PerlModule Apache2::RequestRec

    # set mod_perl2 options
    <Location /otrs>
#        ErrorDocument 403 /otrs/customer.pl
        ErrorDocument 403 /otrs/index.pl
        SetHandler  perl-script
        PerlResponseHandler ModPerl::Registry
        Options +ExecCGI
        PerlOptions +ParseHeaders
        PerlOptions +SetupEnv
        Order allow,deny
        Allow from all
    </Location>

</IfModule>

# directory settings
<Directory "/opt/otrs/bin/cgi-bin/">
    AllowOverride None
    Options +ExecCGI -Includes
    Order allow,deny
    Allow from all
</Directory>
<Directory "/opt/otrs/var/httpd/htdocs/">
    AllowOverride None
    Order allow,deny
    Allow from all
</Directory>

# MaxRequestsPerChild (so no apache child will be to big!)
MaxRequestsPerChild 400
In /opt/otrs/var/log or in /var/log I have no files of OTRS errors.
Where do I find files error log?
OTRS 2.4.8 - ITSM 2.1.1 - FAQ 1.6.5
Server CentOS-5.5-x86_64
Apache 2.2.3 - Mysql 5.0.77 - perl v5.8.8
Mike_B
Moderator
Posts: 266
Joined: 12 Jan 2010, 18:16
Znuny Version: CVS HEAD

Re: Apache slow to respond

Post by Mike_B »

This only says: IF mod_perl is loaded, THEN....

But the question is, do you have mod_perl installed?
You can verify this by running apache2ctl -M
BTW we had an issue with mod_perl on RedHat based distros
http://bugs.otrs.org/show_bug.cgi?id=4977
(fixed since 2.4.8 if you do RPM based installs, please check if it applies to you)
huntingbears.nl - @michielbeijen on Twitter
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Apache slow to respond

Post by Wolfgangf »

In /opt/otrs/var/log or in /var/log I have no files of OTRS errors.
Where do I find files error log?
the apache error log; /var/log/apache2/error_log
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
lucasdgr
Znuny newbie
Posts: 31
Joined: 24 Sep 2010, 14:16
Znuny Version: 2.4

Re: Apache slow to respond

Post by lucasdgr »

I'm confused now.

Apache2 is Apache version 2?

On my system, have not /etc/apache2/.
I have /etc/httpd/.

Code: Select all

[root@localhost ~]# httpd -v
Server version: Apache/2.2.3
I think apache2 is used in some Linux distributions, other than centos. Centos using httpd.

In addition, otrs.CheckModules.pl tells me they're OK all required modules.
OTRS 2.4.8 - ITSM 2.1.1 - FAQ 1.6.5
Server CentOS-5.5-x86_64
Apache 2.2.3 - Mysql 5.0.77 - perl v5.8.8
lucasdgr
Znuny newbie
Posts: 31
Joined: 24 Sep 2010, 14:16
Znuny Version: 2.4

Re: Apache slow to respond

Post by lucasdgr »

Wolfgangf wrote:
In /opt/otrs/var/log or in /var/log I have no files of OTRS errors.
Where do I find files error log?
the apache error log; /var/log/apache2/error_log
I see that in each Loguin I get the following error index.pl login /var/log/httpd/error_log

Code: Select all

[Fri Nov 19 09:01:13 2010] [error] [client 10.1.1.113] [Fri Nov 19 09:01:12 2010] index.pl: Use of uninitialized value in int at ../..//Kernel/Output/HTML/DashboardTicketGeneric.pm line 70., referer: http://10.1.1.159/otrs/index.pl?Action=AgentDashboard
[Fri Nov 19 09:01:13 2010] [error] [client 10.1.1.113] [Fri Nov 19 09:01:13 2010] index.pl: Use of uninitialized value in int at ../..//Kernel/Output/HTML/DashboardTicketGeneric.pm line 70., referer: http://10.1.1.159/otrs/index.pl?Action=AgentDashboard
[Fri Nov 19 09:01:13 2010] [error] [client 10.1.1.113] [Fri Nov 19 09:01:13 2010] index.pl: Use of uninitialized value in int at ../..//Kernel/Output/HTML/DashboardTicketGeneric.pm line 70., referer: http://10.1.1.159/otrs/index.pl?Action=AgentDashboard
[Fri Nov 19 09:01:13 2010] [error] [client 10.1.1.113] [Fri Nov 19 09:01:13 2010] index.pl: Use of uninitialized value in int at ../..//Kernel/Output/HTML/DashboardTicketGeneric.pm line 70., referer: http://10.1.1.159/otrs/index.pl?Action=AgentDashboard
[Fri Nov 19 09:01:14 2010] [error] [client 10.1.1.113] [Fri Nov 19 09:01:14 2010] index.pl: Use of uninitialized value in int at ../..//Kernel/Output/HTML/DashboardUserOnline.pm line 74., referer: http://10.1.1.159/otrs/index.pl?Action=AgentDashboard
The customer.pl says

Code: Select all

[Fri Nov 19 09:14:38 2010] [error] [client 10.1.1.3] Directory index forbidden by Options directive: /var/www/html/
[Fri Nov 19 09:18:15 2010] [error] [client 10.1.1.3] [Fri Nov 19 09:18:15 2010] customer.pl: Use of uninitialized value in int at ../..//Kernel/Modules/CustomerTicketOverView.pm line 49., referer: http://10.1.1.159/otrs/customer.pl
Thanks for your help.
OTRS 2.4.8 - ITSM 2.1.1 - FAQ 1.6.5
Server CentOS-5.5-x86_64
Apache 2.2.3 - Mysql 5.0.77 - perl v5.8.8
lucasdgr
Znuny newbie
Posts: 31
Joined: 24 Sep 2010, 14:16
Znuny Version: 2.4

Re: Apache slow to respond

Post by lucasdgr »

Later, these logs appear when attempting to login again.

Code: Select all

[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113] ERROR: OTRS-CGI-10 Perl: 5.8.8 OS: linux Time: Fri Nov 19 11:17:42 2010, referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113] , referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113]  Message: Can't get file from http://otrs.org/product.xml?Product=OTRS-2.4.8: 500 Can't connect to otrs.org:80 (Bad hostname 'otrs.org'), referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113] , referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113]  Traceback (5320): , referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113]    Module: Kernel::System::WebUserAgent::Request (v1.3) Line: 135, referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113]    Module: Kernel::Output::HTML::DashboardProductNotify::Run (v1.11) Line: 74, referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113]    Module: Kernel::Modules::AgentDashboard::_Element (v1.14.2.3) Line: 396, referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113]    Module: Kernel::Modules::AgentDashboard::Run (v1.14.2.3) Line: 246, referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113]    Module: Kernel::System::Web::InterfaceAgent::Run (v1.43.2.1) Line: 819, referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113]    Module: /opt/otrs/bin/cgi-bin/index.pl (v1.88) Line: 48, referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:42 2010] [error] [client 10.1.1.113] , referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:43 2010] [error] [client 10.1.1.113] [Fri Nov 19 11:17:43 2010] index.pl: Use of uninitialized value in int at ../..//Kernel/Output/HTML/DashboardTicketGeneric.pm line 70., referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:43 2010] [error] [client 10.1.1.113] Directory index forbidden by Options directive: /var/www/html/
[Fri Nov 19 11:17:44 2010] [error] [client 10.1.1.113] [Fri Nov 19 11:17:44 2010] index.pl: Use of uninitialized value in int at ../..//Kernel/Output/HTML/DashboardTicketGeneric.pm line 70., referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:45 2010] [error] [client 10.1.1.113] [Fri Nov 19 11:17:45 2010] index.pl: Use of uninitialized value in int at ../..//Kernel/Output/HTML/DashboardTicketGeneric.pm line 70., referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:45 2010] [error] [client 10.1.1.113] [Fri Nov 19 11:17:45 2010] index.pl: Use of uninitialized value in int at ../..//Kernel/Output/HTML/DashboardTicketGeneric.pm line 70., referer: http://10.1.1.159/otrs/index.pl?Action=Logout
[Fri Nov 19 11:17:45 2010] [error] [client 10.1.1.113] [Fri Nov 19 11:17:45 2010] index.pl: Use of uninitialized value in int at ../..//Kernel/Output/HTML/DashboardUserOnline.pm line 74., referer: http://10.1.1.159/otrs/index.pl?Action=Logout
OTRS 2.4.8 - ITSM 2.1.1 - FAQ 1.6.5
Server CentOS-5.5-x86_64
Apache 2.2.3 - Mysql 5.0.77 - perl v5.8.8
Wolfgangf
Znuny ninja
Posts: 1029
Joined: 13 Apr 2009, 12:26
Znuny Version: 6.0.13
Real Name: Wolfgang Fürtbauer
Company: PBS Logitek GmbH
Location: Pinsdorf

Re: Apache slow to respond

Post by Wolfgangf »

and did you already check if mod_perl is installed on your system?
Produktiv:
OTRS 6.0.13/ ITSM 6.0.13
OS: SUSE Linux (SLES 12, Leap), MySql 5.5.x, 5.6.x
Windows 2012 AD Integration (agents and customers), Nagios integration (incidents, CMDB), Survey, TimeAccounting
Post Reply