Apache, MySQL & PHP - Oh My!

Apache, MySQL & PHP - Oh My!

Post by Michael J Scho » Thu, 24 Apr 1997 04:00:00





>             total       used       free     shared    buffers     cached
>Mem:         14648      14316        332       8004       4904       5200
>-/+ buffers:             4212      10436
>Swap:        17132         12      17120  

Hrm.. According to the above, you still have about 10.5 megs of memory
available (10 megs in buffers, 332 K free already).  Are you SURE you are
out of memory?  Do you see kernel errors liek "cannot get free page"?  The
above really does not look like your out of memory...

Quote:>While I was testing my web pages, I actually ran out of memory and the only
>thing I could do was to walk over to the server and give the three fingered
>salute.  It was as if the memory wasn't being released properly.  I
>installed Apache 1.2b8 and that seemed to help a little bit, the memory
>used doesn't seem to climb as quickly.  

Or it could be an out of control process too.  Im going completely by guess
here, but I would suspect MySQL first.  MySQL is not ready for production
use yet, and contains lots of bugs.  It would not surprise me if that was
the case.  

Are you running PHP as an apache module?  If so, try running "strip" on
your httpd binary as it will contain a lot of debugging symbols by default
when you build it.  THat will reduce the size of the executable by a good
amount.

What version of flex are your running?  PHP has been known to have some
problems with versions of flex prior to 2.5.4 (but not the type of probs
that you seem to be having).

Id suggest killing of MySQL for a while and see if you still have the same
troubles.  Try to see if you have any runaway processes next time the
machine starts to bog down (use top).

Hope this helps...

Regards,
Mike

--
Hal 9000 - "Put down those Windows disks Dave....  Dave?  DAVE!!"

 
 
 

Apache, MySQL & PHP - Oh My!

Post by Dennis Dun » Fri, 25 Apr 1997 04:00:00


I recently got the following packages running together:

Apache 1.2b7
PHP 2.0b10
MySQL 3.20.17-beta
on
Linux altair.ces.fau.edu 2.0.27 #1 Sat Dec 21 23:44:11 EST 1996 i586

Lot of beta there.

I have noticed  what may be a problem with memory usage growing and
eventually crashing my server.  By crash I mean that if I am logged in, I
stay logged in but I can't run any new programs.  I tried to su root and
got libc loading errors.  At the same time my web pages returned errors
saying that PHP couldn't connect to the MySQL database.

When I first start the server, this is what free shows me:

             total       used       free     shared    buffers     cached
Mem:         14648       9360       5288       8004        708       5160
-/+ buffers:             3492      11156
Swap:        17132          0      17132

After viewing some PHP-parsed Web pages which made connections to the MySQL
database, memory usage goes up and never comes down again.  This output is
from about 6 hours after I last accessed the server.  Shouldn't some of the
memory be freed up?  

             total       used       free     shared    buffers     cached
Mem:         14648      14316        332       8004       4904       5200
-/+ buffers:             4212      10436
Swap:        17132         12      17120  

While I was testing my web pages, I actually ran out of memory and the only
thing I could do was to walk over to the server and give the three fingered
salute.  It was as if the memory wasn't being released properly.  I
installed Apache 1.2b8 and that seemed to help a little bit, the memory
used doesn't seem to climb as quickly.  

I've only run out of memory the one time so I don't know if I really have a
problem or not.  
How might I go about troubleshooting the problem?  I suppose I could remove
the MySQL support, add mSQL support in PHP, and see if I have the same type
of problem.

I guess I'm just looking for clues.  I don't know if the problem is Apache,
PHP or MySQL.  Or me.

Here is the URL of the database access page, if you try it and get an error
message from PHP about being unable to connect to the database, you will
know the server has crashed.
http://altair.ces.fau.edu/ces_public/glades/

Thanks for your comments.

--dennis

 
 
 

Apache, MySQL & PHP - Oh My!

Post by Ingo Luetkebohl » Fri, 25 Apr 1997 04:00:00



> I have noticed  what may be a problem with memory usage growing and
> eventually crashing my server.  By crash I mean that if I am logged in, I
> stay logged in but I can't run any new programs.  I tried to su root and
> got libc loading errors.  At the same time my web pages returned errors
> saying that PHP couldn't connect to the MySQL database.

PHP 2b10 has the problem that it doesn't disconnect automatically from
the MySQL server when its finished sending the page (contrary to whats
said in the docs). That means that you will have lots of dangling mysql
servers. Sure, its threaded but it still takes up some amount of memory
for each thread and additionally, mysql has a limit of 90 or so
concurrent connections (that would explain your connection problems).

Solution: You have to do an explicit mysql_close after you're finished.
Alternatively, you can get the latest PHP snapshot, which contains the
fix already.

---/dev/il

 
 
 

1. Apache compile & Php & mysql

Hello.
How i can to compile apache for it works with php and how to compile php for
it works with apache and mysql ?

Regards.
--
---------------------------------------------------------------------
Aix,Linux,Humor,Zoco
http://web.madritel.es/personales2/jperezm
--------------------------------------------------------------------

2. Please help with Slow Samba printing

3. Apache & mysql & php not working

4. Networking Mach10 & Linux

5. Apache, PHP, & MySQL

6. Netscape Communcation Server and CGI

7. FreeBSD 4.4 w/ apache/mysql/php & no joy

8. x in different color-depths (tm5200 laptop)

9. BULL's apache, php & mysql,How to incorporate them

10. What rpms to load so php & mysql will work with Apache?

11. Apache, PHP & MySQL Requirements

12. PHP & MySQL & root

13. Apach&mysql&php install