473,698 Members | 2,337 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

express-c and php very slow

Hi there
i set up php+db2+zend+ap ache2 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@Regenbog en

GPG-Key: http://www.camlann.de/key.asc
Fingerprint: 4F50 19BF 3346 36A6 CFA9 DBDC C268 6D24 70A1 AD15
Jun 27 '08 #1
3 1654
Christian Welzel wrote:
Hi there
i set up php+db2+zend+ap ache2 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@Regenbog en

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
387
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 beta testing and include Visual Basic 2005 Express, Visual C# 2005 Express, Visual C++ 2005 Express, Visual C++ 2005 Express, Visual J# 2005 Express, Visual Web Dev 2005 Express and SQL Server 2005 Express.
5
1656
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 exist or access is denied" when I try to register the SQL Server Express instance via Enterprise Manager. If this is possible, what kind of things should I be looking for to make this work?
0
4543
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 Express Edition v1.3.2 Win, IBM Tivoli System Automation v1.2.0 Linux, IBM Tivoli Workload Scheduler Virtualized Data Centers v8.2 , other IBM Tivoli CDs, WEBSPHERE EVERYPLACE MOBILE PORTAL v5.0 - ALTIUM , other IBM WebSphere Business CDs...
1
1968
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, especially as a Web server or a database server. The second is as a local client data store where the application data access does not depend on the network. Ease of use and simplicity are key design goals.
10
1971
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? Should it be able to? I know it's express edition, and therefore limited functionality, but surely resources are quite fundamental? Also, once it's downloaded, is there any way of getting access to the fully downloaded file incase you want to...
1
6626
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 Express Edition x86: Component Microsoft SQL Server 2005 Express Edition x86 returned an unexpected value. ***EndOfSession***? Microsoft SQL Server 2005 Express Edition x86: Component Microsoft SQL Server 2005 Express Edition x86 returned an...
4
2525
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? 2. Does VWD Express Edition support the idea of Solutions? I coun't figure out how to create a blank solution which I usually do with VS2005 (and then add my web site to the solution.)
3
1334
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 Devlopment Express Edition I know these tools are availabe for free download from microsoft.
13
2431
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 assuming ) if I create an EXE and I load an MDB file, I can see if certain fields are there, and if not add them. Kinda like an Update that is imbeded into the EXE, so you dont always have to create an Install shield.
3
6436
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 get an error at the end of the SQL server install phase 'Invalid endpoint'. (Note SQL server express gets installed OK) If I run SQL server express SP2 setup directly it I don't get the error
0
8608
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9161
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9029
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8897
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8867
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7732
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6522
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.