PDA

View Full Version : APC how to install ?


eva2000
Sun 15th Apr '01, 3:52pm
unfortunately this forum has limited searches to a min 4 character so i can't find the old posts..

How do you install APC - http://apc.communityconnect.com/

version 1.09 came out on March 31, 2001

I currently have PHP 4.04pl1 with zend optimiser v1.0.0 compiled with
'./configure' '--with-apache=../apache_1.3.17' '--with-mysql' '--with-gd' '--with-freetype' '--enable-track-vars' '--with-jpeg-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--enable-ftp' '--enable-sockets' '--with-openssl=/usr' '--with-sysvshm' '--with-sysvsem' '--with-imap' '--with-curl' '--with-zlib'

fastforward
Sun 15th Apr '01, 4:17pm
It's easy peasy. Just do as it says in the instructions. as long as you have phpize and php-config installed somewhere (usually /usr/local/bin) you should have no problems.

Some pointers I found though:
On my new Linux 61. server apache 1.3.9:
1) The ZendOptimizer does not work with APC (or bware). You'll have to decide which gives you better performance increase.
2) I had trouble getting mmap implementation to work with vB when using a seperate cache dir. The shm version works fine though.

Let me know how you get on and what you think the performance is like.

eva2000
Sun 15th Apr '01, 4:26pm
okay problem is where is the instructions ?

1. i have phpize and php-config installed in /usr/local/bin
2. i downloaded the 1.09 file uploaded it my server but untarring it says

tar: This does not look like a tar archive
tar: Skipping to next header
tar: 355 garbage bytes ignored at end of archive
tar: Error exit delayed from previous errors

eva2000
Sun 15th Apr '01, 4:49pm
okay got the file extracted
################################################## ###############
# Compiling and installing as a Zend extension (post-PHP install)
################################################## ###############

0a) Untar these sources and cd apc/
0b) First decide whether you want to run the sysv shared-memory cache
or the memory-mapped implementation. (See the FAQ regarding the
pros and cons of each.)
1) Copy the contents of the mmap or shm driectory into the main
directory.
2) Run phpize (this is installed with php)
3) Run ./configure --enable-apc --with-php-config=<path to php-config>
4) Run make
5) copy modules/php_apc.so to /path/to/where/you/keep/extensions/
6) in your php.ini file add the line
zend_extension="/path/to/where/you/keep/extensions/php_apc.so"
7) You're all set!

################################################## ###############

1. i extracted everything into /usr/local/apc
2. how do you run phpize ?
3. i'd run /configure - enable-apc -- with-php-config=/usr/local/bin/php-config or do i run it adding onto ?

./configure' '--with-apache=../apache_1.3.17' '--with-mysql' '--with-gd' '--with-freetype' '--enable-track-vars' '--with-jpeg-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--enable-ftp' '--enable-sockets' '--with-openssl=/usr' '--with-sysvshm' '--with-sysvsem' '--with-imap' '--with-curl' '--with-zlib'


4. rum make
5. where do i put php_apc.so it's in /usr/local/apc right now
6. so i comment out my zend optimiser lines ?

zend_optimizer.optimization_level=15
zend_extension="/usr/local/zend/lib/ZendOptimizer.so"

and replace with

zend_extension="/usr/local/apc/php_apc.so"

then restart apache right ?

fastforward
Sun 15th Apr '01, 5:11pm
Yep.. that's it. Don't forget to set the cache dir if you are using the mmap implementation. If you don't use a seperate cache dir you will have to set the htdocs directory to writeable by nobody (or the account your webserver runs under). If neither of these conditions are true, it will seem to work but nothing will be cached.

you can verify it's installed by the extra lines in phpinfo()

fastforward
Sun 15th Apr '01, 5:15pm
I just reread you post. You don't need all that other configure guff in number 3. Just do what it says in the install.

eva2000
Sun 15th Apr '01, 5:17pm
just a few things

1. how do i run phpize ?
2. configure command

is it just

/configure - enable-apc -- with-php-config=/usr/local/bin/php-config

PHP is complied with teh following this is irrelevant right ?

./configure' '--with-apache=../apache_1.3.17' '--with-mysql' '--with-gd' '--with-freetype' '--enable-track-vars' '--with-jpeg-dir=/usr' '--with-xpm-dir=/usr/X11R6' '--enable-ftp' '--enable-sockets' '--with-openssl=/usr' '--with-sysvshm' '--with-sysvsem' '--with-imap' '--with-curl' '--with-zlib'

eva2000
Sun 15th Apr '01, 5:19pm
one more thing is this issue http://lists.communityconnect.com/pipermail/apc-cache/2001-April/000568.html still a problem with1.09 and vB ?

fastforward
Sun 15th Apr '01, 5:26pm
It looks like you want to compile apc into php and php into apache right?

If so you're on your own :)

I did it the easy way and compiled it seperately.

To run phpize, you just run it while in the apc directory. All it does is set up the macros according to your config i believe.

I haven't seen any problems, but then again I haven't been running it long.

eva2000
Sun 15th Apr '01, 5:30pm
i just want APC installed as easy as possible but that's the only instructions

which is which

################################################## ###############
# Compiling and installing as a Zend extension (post-PHP install)
################################################## ###############

0a) Untar these sources and cd apc/
0b) First decide whether you want to run the sysv shared-memory cache
or the memory-mapped implementation. (See the FAQ regarding the
pros and cons of each.)
1) Copy the contents of the mmap or shm driectory into the main
directory.
2) Run phpize (this is installed with php)
3) Run ./configure --enable-apc --with-php-config=<path to php-config>
4) Run make
5) copy modules/php_apc.so to /path/to/where/you/keep/extensions/
6) in your php.ini file add the line
zend_extension="/path/to/where/you/keep/extensions/php_apc.so"
7) You're all set!

################################################## ###############
# Compiling and installing as php built-in (during php compile)
################################################## ###############

0a) Untar these sources into PHP_SRC_DIR/ext/apc/
0b) Decide whether you want to run the sysv shared-memory cache
or the memory-mapped implementation. (See the FAQ regarding the
pros and cons of each.)
1) Copy the contents of the mmap or shm driectory into the main
apc directory.
2) In the top-level directory of the php source tree, run autoconf
3) Run ./configure --enable-apc <whatever other compile flags you want>
4) make; make install
5) You're all set!

fastforward
Sun 15th Apr '01, 5:35pm
The first one.

# Compiling and installing as a Zend extension (post-PHP install)

copy the two files from either ./shm or ./mmap to the main dir.

%> phpize
%> ./configure --enable-apc --with-php-config=/usr/local/bin/php-config
%> make

The rest is as it says

eva2000
Sun 15th Apr '01, 5:56pm
thanks the configure and make ran fine

but phpinfo doesn't show the APC cache line

i have php.ini

; zend_optimizer.optimization_level=15
; zend_extension="/usr/local/zend/lib/ZendOptimizer.so"
zend_extension="/usr/local/apc/php_apc.so"

fastforward
Sun 15th Apr '01, 6:06pm
Hmmm. Assuming you copied the file to /usr/local/lib and Apache was restarted with no errors, you should see it. Are you looking in the right place. It should be by the big Zend logo just under the engine stuff.

Make sure you completely shut down and then started apache. Sometimes just a HUP restart doesn't work.

eva2000
Sun 15th Apr '01, 6:14pm
yup i made sure php.ini had the lines in and stoped and restarted apache

http://lists.communityconnect.com/pipermail/apc-cache/2001-January/000334.html

similar problem in this list

fastforward
Sun 15th Apr '01, 6:22pm
Did you get any error messages in the apache logs?

While you were messing with that, I did a compile of php with apc built in. phpinfo() doesn't show it as enabled for me either, although it did with a normal extension compile.

eva2000
Sun 15th Apr '01, 6:29pm
Ah HA seems i didn't copy the php_apc.so module properly :o

it's working and showing up :D

THANKS :)

now what is apcinfo.php file ?


wow... members are definitely noticing the speed on my vB now... 160 users and flying - http://animeboards.com/index.php?s= :)

eva2000
Mon 16th Apr '01, 12:04am
nope no good APC nearly killed my server with a load of 25+ first time ever


Mem: 776656K av, 774336K used, 2320K free, 88236K shrd, 15724K buff
Swap: 265032K av, 63680K used, 201352K free 15752K cached


had one httpd process take up 603MB!!

went back to the Zend optimiser

my cron stats managed to capture the top stats when APC chucked a fit






8:00pm up 16 days, 5:38, 1 user, load average: 9.33, 11.70, 5.98
148 processes: 147 sleeping, 1 running, 0 zombie, 0 stopped
CPU states: 1.4% user, 0.7% system, 0.0% nice, 1.2% idle
Mem: 776656K av, 277708K used, 498948K free, 149848K shrd, 15880K buff
Swap: 265032K av, 186040K used, 78992K free 53408K cached

look at that swap file :eek:

eva2000
Fri 11th May '01, 12:13pm
well since i upgraded on my new server to PHP4.05 and MySQL 3.23.37 with Apache 1.3.19 i'm gonna give APC another go :D

Chris Schreiber
Fri 11th May '01, 12:19pm
Yes give it a try..... I've had it running on my server without any problems at all.... and also have it on Me2Be's forums as well, which helped out alot with the server performance.

I used fastforward's instructions for compiling APC directly into PHP from this thread here: http://www.vbulletin.com/forum/showthread.php?s=&threadid=15620

eva2000
Fri 11th May '01, 12:36pm
thanks Chris i redid the install as above for now .. hopefully it holds together as the positive feedback i had last time it was working was great :D

eva2000
Sat 12th May '01, 3:50am
Originally posted by Chris Schreiber
Yes give it a try..... I've had it running on my server without any problems at all.... and also have it on Me2Be's forums as well, which helped out alot with the server performance.

I used fastforward's instructions for compiling APC directly into PHP from this thread here: http://www.vbulletin.com/forum/showthread.php?s=&threadid=15620 chris the same thing happened again last night on my server APC cache i believe ate into my swap by 40MB and the load went pretty high as i server load limit of 8 in vB was reached

any ideas why this happens ? using

PHP4.05, MySQL 3.23.37, Apache/1.3.19 (Unix), Mod_gzip/1.3.19.1a, mod_bwlimited/0.8, mod_log_bytes/0.2, mod_frontpage/3.0.4.3, mod_ssl/2.8.1, OpenSSL/0.9.6; APC/1.0.8 (SHM)

last top stats and extended-status

12:49am up 11:31, 0 users, load average: 0.00, 0.06, 0.13
122 processes: 120 sleeping, 1 running, 1 zombie, 0 stopped
Mem: 776708K av, 397720K used, 378988K free, 151136K shrd, 26996K buff
Swap: 265032K av, 39720K used, 225312K free 222616K cached


Sat May 12 00:49:39 MDT 2001
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| Aborted_clients | 85 |
| Aborted_connects | 185 |
| Bytes_received | 93245886 |
| Bytes_sent | 1190999236 |
| Connections | 10077 |
| Created_tmp_disk_tables | 30 |
| Created_tmp_tables | 12457 |
| Created_tmp_files | 0 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_delete | 2993 |
| Handler_read_first | 33480 |
| Handler_read_key | 3386860 |
| Handler_read_next | 7238781 |
| Handler_read_prev | 0 |
| Handler_read_rnd | 4227682 |
| Handler_read_rnd_next | 298619938 |
| Handler_update | 68362 |
| Handler_write | 662951 |
| Key_blocks_used | 15112 |
| Key_read_requests | 12920004 |
| Key_reads | 13738 |
| Key_write_requests | 27461 |
| Key_writes | 24972 |
| Max_used_connections | 126 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 124 | 21% of table_cache in use
| Open_files | 165 |
| Open_streams | 0 |
| Opened_tables | 130 |
| Questions | 716889 |
| Select_full_join | 333 |
| Select_full_range_join | 0 |
| Select_range | 78659 |
| Select_range_check | 0 |
| Select_scan | 89826 |
| Slave_running | OFF |
| Slave_open_temp_tables | 0 |
| Slow_launch_threads | 3 |
| Slow_queries | 9 | (execution time > 10 secs)
| Sort_merge_passes | 0 |
| Sort_range | 79157 |
| Sort_rows | 5093058 |
| Sort_scan | 39010 |
| Table_locks_immediate | 630437 |
| Table_locks_waited | 379 |
| Threads_cached | 0 |
| Threads_created | 10076 |
| Threads_connected | 50 |
| Threads_running | 1 |
| Uptime | 39724 | 11 hrs 2 mins 4 secs
+--------------------------+------------+

Key Reads/Key Read Requests = 0.001063 (Cache hit = 99.998937%)
Key Writes/Key Write Requests = 0.909362
Connections/second = 0.254 (/hour = 913.231)
KB received/second = 2.292 (/hour = 8252.341)
KB sent/second = 29.279 (/hour = 105404.944)
Temporary Tables Created/second = 0.314 (/hour = 1128.920)
Opened Tables/second = 0.003 (/hour = 11.781)
Slow Queries/second = 0.000 (/hour = 0.816)
% of slow queries = 0.001%
Queries/second = 18.047 (/hour = 64968.291)

Chris Schreiber
Sat 12th May '01, 3:59am
That's very strange because you have plenty of free memory left over.... the only thing I can think of is it may be leaking semaphores which could be causing the problem.

I would install the APC GUI here: http://apc.neuropeans.com/download/ to keep an eye on what is going on with the cache. Also, if you are using the SHM version, consider trying the MMAP version, which shouldn't have a problem with semaphores.

Chris Schreiber
Sat 12th May '01, 4:18am
George, I tried to respond to your PM, but your mailbox is full :)

Hey George....

Looks good right now.... basically keep an eye on all of the memory fields: the Mem Total should stay at 32.00MB, and make sure the Mem Used doesn't go above 20MB or so. Also keep an eye on the Hits and Misses, the misses are new PHP pages that are loaded into the cache... that should stay stable after the scripts are loaded into the cache (around 60-100).

You said you monitored it last night and it went back to 0?? Did you restart Apache when it went to zero, or did it do this on it's own?

eva2000
Sat 12th May '01, 4:43am
whoops i cleared some of my PM box :)

it reset itself to zero once MemUsed was around 9MB and hits were around 15,000 - 30,000

i'm not sure but from http://lists.communityconnect.com/pipermail/apc-cache/2001-April/000645.html

currently i'm allocating 10 x 32mb = 320mb to caching right ?

Chris Schreiber
Sat 12th May '01, 5:01am
Originally posted by eva2000
it reset itself to zero once MemUsed was around 9MB and hits were around 15,000 - 30,000


Humm that shouldn't happen.... this may be the root of your problem, it looks like it keeps allocating new shared memory seqments, when it should really only need one (you are just running vBulletin, and no other PHP scripts right?)


currently i'm allocating 10 x 32mb = 320mb to caching right ?

Yes but it should only use new seqments when it needs to... try setting

apc.shm_segments="1"

in your php.ini file and see if that helps.

eva2000
Sat 12th May '01, 5:06am
i just set it to

apc.shm_segments=3

do i need to have that in quotations ?

apc.shm_segments="3" ?

vbulletin ain't the only php script i'm running there's also

- phpadsnew 2 beta 2 - serving 90,000 impressions/day
- Ed's marticle article script :D
- and AClinks click through tracker

Chris Schreiber
Sat 12th May '01, 5:08am
Ok, with all those scripts I could see you using 1 or 2 seqments of 32MB..... I am using 23.55MB right now for vBulletin, phpAds, phpMyAdmin, and a couple other scripts. Me2Be is using 25.40MB for two vBulletin boards.

I use the quotes for the values, but I don't think they are required.

eva2000
Sat 12th May '01, 5:13am
thanks i set it at 4 for now and see how it goes in 18 hrs which is the peak of the forum when the problem occured today

if not i'll have to try the mmap version

Chris Schreiber
Sat 12th May '01, 5:17am
Sounds good.... yes if you still have problems, I would switch to the MMAP version which won't have the same problem.

eva2000
Sat 12th May '01, 7:59am
strange happened again but the load jump was only over 1.00+ but ate into my swap from 14mb to 50mb


4:58am up 15:40, 0 users, load average: 0.47, 0.53, 0.27
103 processes: 100 sleeping, 1 running, 2 zombie, 0 stopped
Mem: 776708K av, 173660K used, 603048K free, 96276K shrd, 15724K buff
Swap: 265032K av, 49868K used, 215164K free 41776K cached


Sat May 12 04:58:30 MDT 2001
+--------------------------+------------+
| Variable_name | Value |
+--------------------------+------------+
| Aborted_clients | 143 |
| Aborted_connects | 234 |
| Bytes_received | 112633763 |
| Bytes_sent | 1663791764 |
| Connections | 12654 |
| Created_tmp_disk_tables | 32 |
| Created_tmp_tables | 14853 |
| Created_tmp_files | 0 |
| Delayed_insert_threads | 0 |
| Delayed_writes | 0 |
| Delayed_errors | 0 |
| Flush_commands | 1 |
| Handler_delete | 3803 |
| Handler_read_first | 41086 |
| Handler_read_key | 3988997 |
| Handler_read_next | 9531270 |
| Handler_read_prev | 0 |
| Handler_read_rnd | 4986864 |
| Handler_read_rnd_next | 378578401 |
| Handler_update | 83246 |
| Handler_write | 769564 |
| Key_blocks_used | 15582 |
| Key_read_requests | 15322602 |
| Key_reads | 15265 |
| Key_write_requests | 33872 |
| Key_writes | 30982 |
| Max_used_connections | 126 |
| Not_flushed_key_blocks | 0 |
| Not_flushed_delayed_rows | 0 |
| Open_tables | 152 | 25% of table_cache in use
| Open_files | 216 |
| Open_streams | 0 |
| Opened_tables | 158 |
| Questions | 871157 |
| Select_full_join | 337 |
| Select_full_range_join | 0 |
| Select_range | 92776 |
| Select_range_check | 0 |
| Select_scan | 109671 |
| Slave_running | OFF |
| Slave_open_temp_tables | 0 |
| Slow_launch_threads | 3 |
| Slow_queries | 10 | (execution time > 10 secs)
| Sort_merge_passes | 0 |
| Sort_range | 93664 |
| Sort_rows | 5892201 |
| Sort_scan | 46988 |
| Table_locks_immediate | 763101 |
| Table_locks_waited | 445 |
| Threads_cached | 0 |
| Threads_created | 12653 |
| Threads_connected | 36 |
| Threads_running | 1 |
| Uptime | 54655 | 15 hrs 10 mins 55 secs
+--------------------------+------------+

Key Reads/Key Read Requests = 0.000996 (Cache hit = 99.999004%)
Key Writes/Key Write Requests = 0.914679
Connections/second = 0.232 (/hour = 833.490)
KB received/second = 2.012 (/hour = 7244.988)
KB sent/second = 29.728 (/hour = 107021.601)
Temporary Tables Created/second = 0.272 (/hour = 978.333)
Opened Tables/second = 0.003 (/hour = 10.407)
Slow Queries/second = 0.000 (/hour = 0.659)
% of slow queries = 0.001%
Queries/second = 15.939 (/hour = 57381.122)

eva2000
Sat 12th May '01, 8:05am
holy cow httpd process using 403MB!! and the load going up attached screen caps

eva2000
Sat 12th May '01, 8:06am
after cap

eva2000
Sat 12th May '01, 8:13am
oh my god :eek:

eva2000
Sat 12th May '01, 8:18am
seems to be happening when i visit a certain page on animeboards.com - it ain't apart of vBulletin but even when i have removed the page accessing the directory it was in causes it to go crazy

httpd process consuming 657MB!!

eva2000
Sat 12th May '01, 9:21am
still going but i think i found the problem with a bad script that was cached i deleted the script but it is still in cache and whenever i access the url it was in it will trigger the high load and memory usage

i tried restarting apache but it doesn't clear the cache

Chris Schreiber
Sat 12th May '01, 9:27am
Originally posted by eva2000
i tried restarting apache but it doesn't clear the cache

Restarting Apache *should* clear the cache.... however rebooting would definately clear it. The only other way would be to use "ipcrm" to remove the shared memory manually, but this is something I wouldn't recommend.

Chris Schreiber
Sat 12th May '01, 9:29am
Eva.... can you run "ipcs" on your server and paste the output here?

eva2000
Sat 12th May '01, 9:35am
Originally posted by Chris Schreiber
Eva.... can you run "ipcs" on your server and paste the output here? okay here it is

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 14720 root 600 1056768 39 dest
0x00000000 14849 root 622 303144 39 dest
0x00000000 14722 root 622 33554431 39 dest
0x00000000 14851 root 622 33554431 39 dest
0x00000000 14852 nobody 600 184324 39 dest

------ Semaphore Arrays --------
key semid owner perms nsems status
0x00000000 4864 root 666 1
0x00000000 4865 root 666 1
0x00000000 4866 root 666 1
0x00000000 4867 root 666 1
0x00000000 4868 nobody 600 1
0x00000000 9733 root 666 1
0x00000000 9734 root 666 1
0x00000000 9735 root 666 1
0x00000000 9736 root 666 1
0x00000000 9737 nobody 600 1
0x00000000 14730 root 666 1
0x00000000 14731 root 666 1
0x00000000 14732 root 666 1
0x00000000 14733 root 666 1
0x00000000 15886 root 666 1
0x00000000 15887 root 666 1
0x00000000 15888 root 666 1
0x00000000 15889 root 666 1
0x00000000 16402 root 666 1
0x00000000 16403 root 666 1
0x00000000 16404 root 666 1
0x00000000 16405 root 666 1
0x00000000 16406 nobody 600 1
0x00000000 16919 root 666 1
0x00000000 16920 root 666 1
0x00000000 16921 root 666 1
0x00000000 16922 root 666 1
0x00000000 16923 nobody 600 1
0x00000000 17436 root 666 1
0x00000000 17437 root 666 1
0x00000000 17438 root 666 1
0x00000000 17439 root 666 1
0x00000000 17440 nobody 600 1
0x00000000 17953 root 666 1
0x00000000 17954 root 666 1
0x00000000 17955 root 666 1
0x00000000 17956 root 666 1
0x00000000 17957 nobody 600 1
0x00000000 18470 root 666 1
0x00000000 18471 root 666 1
0x00000000 18472 root 666 1
0x00000000 18473 root 666 1
0x00000000 18474 nobody 600 1
0x00000000 20139 root 666 1
0x00000000 20140 root 666 1
0x00000000 20141 root 666 1
0x00000000 20142 root 666 1
0x00000000 20143 nobody 600 1
0x00000000 20656 root 666 1
0x00000000 20657 root 666 1
0x00000000 20658 root 666 1
0x00000000 20659 root 666 1
0x00000000 20660 nobody 600 1

------ Message Queues --------
key msqid owner perms used-bytes messages

Chris Schreiber
Sat 12th May '01, 9:47am
Ok, the shared memory segments look pretty much identical to what I have on my system, and some others I've just checked, assuming you have about 39 apache processes running (which is normal).

However, it looks like you have way too many Semaphore Arrays. Here's what I typically see:

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 4736 root 622 303172 23 dest
0x00000000 4609 root 622 33554431 23 dest
0x00000000 4738 root 622 33554431 23 dest
0x00000000 4739 nobody 600 46084 23 dest

------ Semaphore Arrays --------
key semid owner perms nsems status
0x00000000 7680 root 666 1
0x00000000 7681 root 666 1
0x00000000 7682 root 666 1
0x00000000 7683 root 666 1

------ Message Queues --------
key msqid owner perms used-bytes messages

eva2000
Sat 12th May '01, 10:02am
i completely rebooted my server anyway and I am gonna see if the cache was deleted

what exactly are Semaphore Arrays ?

update: reboot didn't help the deleted script is still being cached and called

after reboot

------ Shared Memory Segments --------
key shmid owner perms bytes nattch status
0x00000000 3456 root 600 1056768 29 dest
0x00000000 3585 root 622 303140 29 dest
0x00000000 3458 root 622 33554431 29 dest
0x00000000 3587 root 622 33554431 29 dest
0x00000000 3588 nobody 600 184324 29 dest

------ Semaphore Arrays --------
key semid owner perms nsems status
0x00000000 3840 root 666 1
0x00000000 3841 root 666 1
0x00000000 3842 root 666 1
0x00000000 3843 root 666 1
0x00000000 4868 root 666 1
0x00000000 4869 root 666 1
0x00000000 4870 root 666 1
0x00000000 4871 root 666 1
0x00000000 3848 nobody 600 1
0x00000000 4873 nobody 600 1

------ Message Queues --------
key msqid owner perms used-bytes messages

Chris Schreiber
Sat 12th May '01, 10:06am
Originally posted by eva2000
what exactly are Semaphore Arrays ?

Semaphores are shared space in memory for interprocess communications (IPC) controlled by "wake up" and "sleep" commands. The source process fills a queue and goes to sleep until the destination process uses the data and tells the source process to wake up.

The problem with Semaphores is they can sometimes "leak" between processes... which is what I believe is happening in your case. I think it's time to consider switching to the memory-mapped files version of APC which will not have this problem.

eva2000
Sat 12th May '01, 10:35am
okay looks like mmap here i come :)

thanks chris

Chris Schreiber
Sat 12th May '01, 10:51am
Originally posted by eva2000
okay looks like mmap here i come :)

Sounds good... the speed improvements should be about the same, without the semaphore problems.

Before you switch over, just check the value of

cat /proc/sys/fs/file-max

To make sure you have enough file handles available.

eva2000
Sat 12th May '01, 12:12pm
Originally posted by Chris Schreiber


Sounds good... the speed improvements should be about the same, without the semaphore problems.

Before you switch over, just check the value of

cat /proc/sys/fs/file-max

To make sure you have enough file handles available. hmmmm mmap didn't turn out right.. this is what i did

1. deleted the /usr/local/apc directory i had
2. untarred a new apc.tar in it's place
3. went through the install for mmap
4. edited php.ini for the entry

zend_extension="/usr/lib/apache/php_apc.so"
apc.cachedir="/home/apcache/cache"
apc.relative_includes="1"

5. restarted apache

and in phpinfo it showed up as APC 1.08 MMAP

but the APC Gui couldn't detect a version it said version unknown and the apcinfo.php file showed no entries at all

cat /proc/sys/fs/file-max

reveals a setting = 131072



Update: hehe i couldn't resist so i downloaded and installed the 30 day trial of Zend Cache and works so far :)

benchmarked the get today's active threads page and 110.8 % improvement :D

strange though i benchmarking the front page was a negative result

http://animeboards.com/index.php?s=
With cache
Starting benchmark for http://animeboards.com/index.php?s= (5 tries)...
Try 1: 2.87 req/s
Try 2: 2.84 req/s
Try 3: 2.31 req/s
Try 4: 2.95 req/s
Try 5: 2.93 req/s
http://animeboards.com/index.php?s=: 2.78 requests/second from 5 tries

Without cache
Starting benchmark for http://animeboards.com/index.php?s= (5 tries)...
Try 1: 2.93 req/s
Try 2: 2.93 req/s
Try 3: 2.80 req/s
Try 4: 2.74 req/s
Try 5: 2.62 req/s
http://animeboards.com/index.php?s=: 2.804 requests/second from 5 tries

Speedup: -0.86%

Chris Schreiber
Tue 5th Jun '01, 10:10am
Eva, when you had APC Cache installed, did you ever restart Apache with "apachectl restart" or through webmin? I just restarted Apache on my server and noticed it took another 32MB shared memory segment. I then shut down Apache with "apachectl stop" and started with "apachecrl start" and this cleared out all my shared memory properly.

eva2000
Wed 6th Jun '01, 3:10pm
well i used

/etc/rc.d/init.d/httpd start
/etc/rc.d/init.d/httpd stop

to start and stop apache ... always have

could this be the problem ?

Chris Schreiber
Wed 6th Jun '01, 3:49pm
Originally posted by eva2000
could this be the problem ?

No I don't think so, that seems to work fine when I do a stop then start. It was just when I just a restart in one command that I had the problem.

eva2000
Fri 26th Oct '01, 11:05am
just installed APC 1.1.0pl1 to see how it goes.. hopefully no more leaks :D