Women in Technology

Hear us Roar



Article:
  The PHP Scalability Myth
Subject:   You don't know what you're talking about
Date:   2003-10-17 06:46:22
From:   anonymous2
Response to: You don't know what you're talking about

It's irrelevant, you say?


Now I'd prefer to place two cheap Linux boxes together than a big server (with expensive processors / ram).


If I want to make user sessions available under failure on one of the boxes, can I do that with PHP? Does PHP replicate sessions between those two linux boxes?


Go do some homework again...

Full Threads Newest First

Showing messages 1 through 3 of 3.

  • You don't know what you're talking about
    2003-10-17 08:01:37  anonymous2 [View]

    "If I want to make user sessions available under failure on one of the boxes, can I do that with PHP?"

    Yes.

    "Does PHP replicate sessions between those two linux boxes?"

    By default? No, that would be silly. Can it do it though, yes. Have I done, it, yes. Was it a hack to do? No.

    "Go do some homework again..."

    Start yours.
  • You don't know what you're talking about
    2003-10-17 08:19:11  anonymous2 [View]

    "Does PHP replicate sessions between those two linux boxes?"

    You're missing the point. It's not PHP's job to replicate sessions (PHP doesn't re-invent a whole bunch of existing technologies). [of course there's an expection - PHP's MSession extension]

    PHP simply provides a session API to store sessions _somewhere_ - it's up to you where you put the sessions - in the filesystem, in a database, in shared memory.

    Once stored, replication happens at a lower level - filesystem / network / OS and Linux does a very good job of clustering these days.

    Doing things this way (as opposed to using an application server) fits nicely with typical corporate infrastructures - most importantly the existing sysadmin staff will know how handle it (vs. having to become a Java Sysadmin as well).
  • You don't know what you're talking about
    2003-10-20 05:48:35  anonymous2 [View]

    Homework? Listen, I don't purport to know anything about Java, so I'm not going to wax poetic about how I think Java sucks, or can't do fully available sessions across an enterprise.

    What I CAN tell you is that the two other people who replied to your message are right -- PHP gives you the API to store your sessions anywhere you want. I choose a nicely replicated and fully redundant MySQL setup, storing sessions in the DB. This allows each of the 5 web servers running the PHP code to access the same session data regardless of which of the 5 servers you go to. It accesses the same data, allowing two clients on two different servers to add/change/delete data, allowing MySQL to handle the blocking/locking.

    I'm sure you can tell us how Java does this -- I don't really care though. The point is that a language doesn't have to do everything, and one that does everything probably has some bloat going on. Does Java replicate sessions between servers? Why? Why should your programming language be responsible for something like that, when it could just provide an API to whatever method of session storage you wanted?