Mombu the Programming Forum sponsored links

Go Back   Mombu the Programming Forum > Programming > simple multiuser considerations
User Name
Password
REGISTER NOW! Mark Forums Read

sponsored links


Reply
 
1 8th April 13:25
joseph s.
External User
 
Posts: 1
Default simple multiuser considerations



Hi everyone,
Managing sessions and cookies looks simple if you go by the varied
tutorials on the web. But I have a few questions about real multiuser
issues which i could not get any tutorials on:

1)say, I have a page doesalot.php on http://www.mysite.com/ which will
be accessed by say 50 users at a time. Then, my session id checking
script must run 50 instances, one for each user and the appropriate
database table must, at the end of that time, get 50 rows, one for each


in php.ini or anywhere else or worse, take care of it in the script by
checking for IP via $_SERVER['REMOTE_ADDR'] etc.

2) If it is just 5-10 users per second maybe it will not be a problem,
but a worst-case load of say 50-100 requests per second will definitely
be an issue (assuming my host has given me enough bandwidth). Is there
some setting for such tuning?

It'll be great if someone could point me to a site or tutorial that
deals with these issues.

Thanks in advance,
Regards,
Joseph S.
  Reply With Quote


  sponsored links


2 8th April 13:25
justin koivisto
External User
 
Posts: 1
Default simple multiuser considerations



Take a look into session_set_save_handler:
http://us2.php.net/manual/en/function.session-set-save-handler.php

You may find something that will save you a lot of time.

--
Justin Koivisto, ZCE - justin@koivi.com
http://koivi.com
  Reply With Quote
3 10th April 14:45
joseph s.
External User
 
Posts: 1
Default simple multiuser considerations


Let me rephrase my question,

If i have a page dosomething.php which three users situated at
geographically diverse locations are simultaneously viewing, and if I
use
$_SESSION['x']=$_GET['x'];
or some such code,
then,
are there, in the server machine's RAM, totally three different
$_SESSION['x'] variables with their respective values or is there just
one?

I looked up and found (send win enabler white paper) that the CGI
installation of PHP under Apache,Windows works like that - there is "a
separate process initiated" for each request of the dosomething.php
page and apparently (not clearly stated) not the apache module version
of PHP.

It also says that php on apache 1.3 on Unix (or linux) uses a
multiprocess webserver - meaning one process for each request.

I have a WinXP machine for development and will be deploying to a host
that has PHP and MySQL on Apache on Linux.

Will that setup be <one request one $_SESSION['x'] variable> ?

***************


and behave thread safe?
In other words, do I have to do anything else to my $_SESSION['x'] =
$_GET['x'] for the code to work on LAMP after seeing it run properly on
my single user WAMP development setup?
***************

Thanks in advance.
Joseph S.
  Reply With Quote
4 11th April 17:39
tim roberts
External User
 
Posts: 1
Default simple multiuser considerations


There will, of course, be three separate session data structures, and three
separate instances of $_SESSION['x']. That is the entire point of using
sessions -- to distinguish between different users.


Well, sort of; *every* CGI request, regardless of the language, starts up a
new process. When the request has been handled, the process ends
(usually). The session stuff has to be put in a store somewhere so that it does not evaporate.


No.
--
- Tim Roberts, timr@probo.com
Providenza & Boekelheide, Inc.
  Reply With Quote


  sponsored links


Reply


Thread Tools
Display Modes




Copyright © 2006 SmartyDevil.com - Dies Mies Jeschet Boenedoesef Douvema Enitemaus -
666