473,804 Members | 3,383 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

[Re] Need help with postgresql/apache/php optimisation

Thx for your quick answer too :)

Richard Huxton wrote:

On Wednesday 18 February 2004 20:18, Froggy / Froggy Corp. wrote:
Hello,

I asked one time for more "benchmark" soft to know where is the cpu
average, and read the post about optimising the postgresql.conf (and use
them), but i allways get a load > 1 on fire time (dunno the right name,
"coup de feu" in french (10h00 -> 14h00, 18h00 -> 21h00).
This is the period when you get the most hits, yes?


yes
With different software, i dont see anything wrong (or i dont understand
how to use them), the problem is the memory which make some nice road
around 12Mo Free and 3Mo Free, but the swap dont really grow up (but
linux make a lot of cache).


Not sure I understand you fully, but if swap isn't active you should be OK.
See below for a good test.


Swap is active, but the size don't change a lot. (12Mb common time,
maybe 50Mb on rush time).
There are three things to look at while testing this:
1. The output of "vmstat 1" - this will show memory usage, swap activity disk
blocks in/out, cpu usage etc.
2. The output from "top", press "M" to sort by memory usage - that way we can
see how much memory is being used.
3. How many requests are you processing at the same time?


I will use vmstat 1 tomorrow (22:24 here, so too late)

Around 4/5 postgresql thread and around 20 apache thread with top.
With mod-status from apache, i get same information, 20 requests in
process, but only some in activity.
If someone could help me, i need to put a new feature which will add
more than 2000 hit per day and im afraid about the life of the server


Only 5000 hits per day? I'm sure we can get that working.


I hope :D.

Another question, i put on postgresql.conf a limited number of
postgresql max_connections , and use permanent link beetween apache and
postgresql. The problem is that a lot of apache thread is used for
sending data (gfx). Is there a way to say that some thread are only here
for php process ?

thx in advance,
regards,

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 22 '05 #1
3 2427
On Wed, 18 Feb 2004, Froggy / Froggy Corp. wrote:
Another question, i put on postgresql.conf a limited number of
postgresql max_connections , and use permanent link beetween apache and
postgresql. The problem is that a lot of apache thread is used for
sending data (gfx). Is there a way to say that some thread are only here
for php process ?


No, PHP's "connection pooling" is more of an accident looking for a place
to happen than useful sometimes. you might want to try reverting to just
plain pg_connects and see how the machine behaves.
---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend

Nov 22 '05 #2
In fact, under php4.?, the connexion is not save under session, so i
allways need to make a pg_connect. But under documentation it say that
the socket stay open, so i save some cpu.

"scott.marl owe" wrote:

On Wed, 18 Feb 2004, Froggy / Froggy Corp. wrote:
Another question, i put on postgresql.conf a limited number of
postgresql max_connections , and use permanent link beetween apache and
postgresql. The problem is that a lot of apache thread is used for
sending data (gfx). Is there a way to say that some thread are only here
for php process ?


No, PHP's "connection pooling" is more of an accident looking for a place
to happen than useful sometimes. you might want to try reverting to just
plain pg_connects and see how the machine behaves.


---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match

Nov 22 '05 #3
On Wednesday 18 February 2004 21:35, Froggy / Froggy Corp. wrote:

Another question, i put on postgresql.conf a limited number of
postgresql max_connections , and use permanent link beetween apache and
postgresql. The problem is that a lot of apache thread is used for
sending data (gfx). Is there a way to say that some thread are only here
for php process ?


Given your lack of memory, I'd drop the permanent (persistent) connections
between php and postgresql - connect for every page you need to. That should
free up some memory.

Once we have the vmstat figures, we can look at how to tune postgresql.conf
--
Richard Huxton
Archonet Ltd

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html

Nov 22 '05 #4

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

Similar topics

9
4967
by: Penn Markham | last post by:
Hello all, I am writing a script where I need to use the system() function to call htpasswd. I can do this just fine on the command line...works great (see attached file, test.php). When my webserver runs that part of the script (see attached file, snippet.php), though, it doesn't go through. I don't get an error message or anything...it just returns a "1" (whereas it should return a "0") as far as I can tell. I have read the PHP...
0
5412
by: no-spam | last post by:
Hello group, I have some questions concerning configuring and using a JNDI DataSource with PostgreSQL and Apache Tomcat. Currently, I belive I have successfully configured a "basic" DataSource. Currently, my configuration which resides in a context.xml file is as follows: <Context className="org.apache.catalina.core.StandardContext" backgroundProcessorDelay="-1" cachingAllowed="true"
7
6668
by: Abdul-Wahid Paterson | last post by:
Hi, I have had a site working for the last 2 years and have had no problems until at the weekend I replace my database server with a newer one. The database migration went like a dream and I had the whole db changed over in 1 hour. Since the upgrade I have been getting the following error message sporadically.
20
6644
by: Keith G. Murphy | last post by:
I'm trying to get a feel for what most people are doing or consider best practice. Given a mod_perl application talking to a PostgreSQL database on the same host, where different users are logging onto the web server using LDAP for authentication, do most people 1) have the web server connecting to the database using its own user account (possibly through ident), and controlling access to different database entities strictly through...
19
5259
by: Alex Madon | last post by:
Hello, I am testing a web application (using the DBX PHP function to call a Postgresql backend). I have 375Mb RAM on my test home box. I ran ab (apache benchmark) to test the behaviour of the application under heavy load. When increasing the number of requests, all my memory is filled, and the Linux server begins to cache and remains frozen. ab -n 100 -c 10 http://localsite/testscript
6
3612
by: Lee Harr | last post by:
I have a database where I remove the schema public. When I try to use the createlang script, it fails like this ... >createdb foo CREATE DATABASE >psql foo -c "select version()" version --------------------------------------------------------------------- PostgreSQL 7.4.1 on i386-portbld-freebsd4.9, compiled by GCC 2.95.4 (1 row)
3
500
by: Froggy / Froggy Corp. | last post by:
First thx for your quick answer :) iostat dont return bad load average. I never grow up to 1Mb/s and the IDE drive can go faster. I really can't change the server, its a locative server which i own (only me on the server, no cooperative, but i dont have physically access to it). So the configuration is ... not the best :). And at this time, i dont have money for server-hosting.
2
3162
by: Suha Onay | last post by:
Hi, I have a problem with PostgreSQL 7.4. (With the old one 7.3 no probllem.) I create a connection and a statement : Class.forName("org.postgresql.Driver"); conn = DriverManager.getConnection( O_Constants.DB_CONNECTION_URL, O_Constants.DB_CONNECTION_USERNAME, O_Constants.DB_CONNECTION_PASSWORD); st = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
12
1825
by: howa | last post by:
any side effect for PHP? what do you think?
0
10073
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
9134
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
7609
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
6846
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5513
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5645
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4288
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
2
3806
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2981
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.