LISTSERV mailing list manager LISTSERV 16.0

Help for LINUX-L Archives


LINUX-L Archives

LINUX-L Archives


LINUX-L@LISTS.UFL.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Monospaced Font

LISTSERV Archives

LISTSERV Archives

LINUX-L Home

LINUX-L Home

LINUX-L  2007

LINUX-L 2007

Subject:

Re: storing php sessions in memory

From:

Eric Lavigne <[log in to unmask]>

Reply-To:

Platform Independent Linux List! <[log in to unmask]>

Date:

Wed, 14 Mar 2007 14:51:42 -0400

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (39 lines)

> I'm looking at my default memory_limit of 16M, and that seems small.
>

Assuming that's 16MB per simultaneous PHP request, that means you can
service less than 200 simultaneous requests on a 3GB server. If the
PHP process only needs to make database calls and process a 3kB string
(webpage), then 16MB doesn't sound so small.

> Is adding more memory to the PHP processes helpful at all in terms of PHP
> execution speed (assuming a "loaded" site)?
>

I haven't tuned PHP programs before either, but I would guess that
it's one of three cases:
1) If there's not enough memory per process, then the extra memory
requirements go to swap (agonizingly slow because we're talking about
very short lived processes).
2) If there's not enough memory per process, then any process that
goes over its requirements aborts and sends a default static error
page.
3) The limit is a minimum, not a maximum. Threads that need more will
take a bit of extra time to request an additional memory allocation.

Option 1 would indicate that PHP is very poorly designed, and I think
that is unlikely.

Option 2 might make sense from a security standpoint, if you would
prefer for a poorly written PHP script to just die instead of hogging
all of your system's resources.

Option 3 is what I would prefer as a developer (and this is how I
would guess it is designed), because then an incorrect value of
memory_limit would only have a slight performance penalty that I could
ignore until my server had performance issues. In this case, you would
want memory_limit to be higher than what 90% of your scripts would use
and lower or not much higher than what 100% of them use. Putting
memory_limit much higher than that would waste memory without speeding
anything up. There should be a memory profiling tool that would help
to determine if the setting needs to be changed.

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

2020
2019
2018
2017
2016
2015
2014
2013
2012
2011
2010
2009
2008
2007
2006
2005
2004
2003
2002
2001
2000
1999
1998
1997

ATOM RSS1 RSS2



LISTS.UFL.EDU

CataList Email List Search Powered by the LISTSERV Email List Manager