473,405 Members | 2,261 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

express-c and php very slow

Hi there
i set up php+db2+zend+apache2 on my linux server (debian/etch amd) and
have great problems with the performance of queries. I currently have
50 empty tables and 2 filled ones (one with 11 rows, the other with 60)
if i issue a simple "select * from table1" (11 results), its takes up to
6 seconds to get the result. Other dynamic pages, but without db access
return in 200ms.

Does anybody know if this is typical for an php-app with express-c ?
Where can i start to tune the system?

(Server is an AMD Athlon 64 X2 6000+, Dual Core with 6gb RAM)

--
MfG, Christian Welzel aka Gawain@Regenbogen

GPG-Key: http://www.camlann.de/key.asc
Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15
Jun 27 '08 #1
3 1631
Christian Welzel wrote:
Hi there
i set up php+db2+zend+apache2 on my linux server (debian/etch amd) and
have great problems with the performance of queries. I currently have
50 empty tables and 2 filled ones (one with 11 rows, the other with
60) if i issue a simple "select * from table1" (11 results), its
takes up to 6 seconds to get the result. Other dynamic pages, but
without db access return in 200ms.

Does anybody know if this is typical for an php-app with express-c ?
Where can i start to tune the system?

(Server is an AMD Athlon 64 X2 6000+, Dual Core with 6gb RAM)
Hmm ... that's too slow to be caused by a lack of statistics on the
tables (given the tiny size of the tables). I'd hazard a guess that
your PHP app is the only thing connecting to the database? i.e. there
are no other connections to the database at all? I'd also guess that
you're not using connection pooling / persistent connections?

If so, you might be running into the "activation" penalty: when a DB2
database has no connections, it's "inactive". When a connection is made
to an inactive database several (expensive) things happen: buffer pools
are allocated, logs are formatted (if necessary), etc. etc. When that
connnection is closed, assuming there are no other connections to the
database, it becomes inactive again.

Hence, if you're not using persistent connections, and there aren't
lots of requests you'll be activating and deactivating the database all
the time (with horrid performance penalties). There's a couple of ways
around this:

1) Use the "ACTIVATE DB dbname" command. This opens a "fake" permanent
connection to the database to keep it in the active state. Subsequent
connections will be made much faster. Note that you'll need to use
"DEACTIVATE DB dbname" before performing any offline tasks (e.g. an
offline backup).

2) A better idea is to change the application to use persistent
connections / connection pooling. However, before doing that I'd use
ACTIVATE DB just to see if this is actually what the problem is.
Cheers,

Dave.
Jun 27 '08 #2
Hi Dave,
I'd hazard a guess that
your PHP app is the only thing connecting to the database?
Yes, it is.
I'd also guess that
you're not using connection pooling / persistent connections?
Correctly. I dont know if the php-db2-driver supports this, but i
investigate this.
2) A better idea is to change the application to use persistent
connections / connection pooling. However, before doing that I'd use
ACTIVATE DB just to see if this is actually what the problem is.
I activated the database and now the requests are handled very
fast. Seems this solved my problem at a first step.
As we are in a very early state of development, this solution is
ok for me, but for later use i will look for some pooling code
as you suggested.

--
MfG, Christian Welzel aka Gawain@Regenbogen

GPG-Key: http://www.camlann.de/key.asc
Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15
Jun 27 '08 #3
Christian Welzel wrote:
Hi Dave,
I'd hazard a guess that
your PHP app is the only thing connecting to the database?

Yes, it is.
I'd also guess that
you're not using connection pooling / persistent connections?

Correctly. I dont know if the php-db2-driver supports this, but i
investigate this.
I'm no PHP expert (I've never used it heavily), but it looks like
there's a db2_pconnect() function which might be handy:

http://php.net/manual/en/function.db2-pconnect.php
>
2) A better idea is to change the application to use persistent
connections / connection pooling. However, before doing that I'd use
ACTIVATE DB just to see if this is actually what the problem is.

I activated the database and now the requests are handled very
fast. Seems this solved my problem at a first step.
Excellent, glad to hear it :)
As we are in a very early state of development, this solution is
ok for me, but for later use i will look for some pooling code
as you suggested.
I'd recommend connection pooling / persistent connections as a long
term solution simply because if you have to reboot the server at some
point (or restart DB2, or whatever) the database will be inactive again
and performance will suffer until ACTIVATE DB is performed again. You
could always set up a little script to automatically activate the
database on reboot or something similar, but I feel persistent
connections are a "cleaner" solution.

Of course, in some cases ACTIVATE DB is the only (easy) solution. For
example, CGI applications which don't persist between requests can't
hold a persistent connection (things like SQLRelay are an alternative
solution, although rather more complex, in such circumstances).
Cheers,

Dave.
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Bootstrap Bill | last post by:
A new Google group has been formed for the purpose of discussing the new Visual Studio Express products. http://groups-beta.google.com/group/Visual-Studio-Express The products are currently in...
5
by: RDV | last post by:
I have 2 SQL Server Express questions: 1) Can you manage a SQL Server Express installation from the regular SQL Server Enterprise Manager? I am getting a message that says "SQL Server does not...
0
by: Zorba.GR | last post by:
IBM DB2 Connect Enterprise Edition v8.2, other IBM DB2 (32 bit, 64 bit) (MULTiOS, Windows, Linux, Solaris), IBM iSoft Commerce Suite Server Enterprise v3.2.01, IBM Tivoli Storage Resource Manager...
1
by: Darryl Kerkeslager | last post by:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsse/html/sseoverview.asp SQL Server Express was developed with two distinct uses in mind. The first is as a server product,...
10
by: Bonj | last post by:
Hi I installed .NET 2005 express edition, and am about to unnistall it again because it can't seem to be able to even insert a resource file into a project. Can anyone tell me is this right?...
1
by: Peter | last post by:
I've purchased VS.NET 2005 Standard and have tried to install SQL Server 2005 Express, but get the following error in the error log. Please could someone help me.... Microsoft SQL Server 2005...
4
by: Andrew Robinson | last post by:
My main dev machine has WinXp and VS2005 (pro). 1. I need to install VWD Express Edition so that I can do some instruction on this. Any issues with both on the same machine. Installation order?...
3
by: msnews.microsoft.com | last post by:
Hello Can any one tell me that if I buy Microsoft Visual Studio 2005 Professional for dotnet, do I get following product Visual Basic Express Visual C# Express Sql Server Express Web...
13
by: Miro | last post by:
Ok I have been slowely - and ever so slowely teaching myself VB.net Currently I have created an MDB file by code, and added fields to the MDB file by code. I like this solution because, ( im...
3
by: Steve | last post by:
Hi All I downloaded Sql server 2005 express SP2 and attempted to modify the Bootstrapper package files as I did with SP1 When i try to install SQL server as part of my VS 2005 deployment app I...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.