You wrote:
Is there a possibility to increase the logon speed? if not -
How can i fix the problem i described above, how can i increase a sessions lifetime?
1) Yes, depending on what server-side OS you are using. One way to reduce the logon time is to have the server processes be already available when a client tries to connect to the database. Two Oracle options exist for this: "Multi-Threaded Server" (MTS) and "Prespawned dedicated server processes". Use MTS if your server OS supports it. MTS is designed to handle the situation where clients frequently connect/disconnect or where they just want to run some quick(=short runtime) SQL statements. MTS precreates server processes and then shares them across multiple concurrent clients. MTS can handle, but is not really designed for, clients which execute long running SQL statements (example: where each SQL statement takes many minutes/hours to run). Luckily long running SQL is rarely found in websites since fast response is highly valued by web clients.
"Prespawned dedicated server processes" does exactly what its name implies. It starts a number of dedicated (not shared like MTS) server-side processes. Since the processes already exist when the client tries to connect in, you don't run into a delay waiting for the server OS to start a new server process.
Also make sure that you have plenty of physical RAM (not just swap space) and that the server is tuned to use it. Sizing the Oracle SGA incorrectly can cause the OS to page it to death yielding in poor response time. MTS can also reduce the amount of RAM you need since the server processes are shared by multiple concurrent clients.
I assume that you have already verified that it is the actual database connect that it taking the 6+ seconds rather than just something slowing down Net8/SQL*Net getting to the database in order to log on. For example, slow DNS can make the total connection process take a long time and you can spend hours/weeks trying to tune the logon process only to find that it isn't the database's fault. I know this from personal experience.
2) It sounds like PHP's PLogon is the one creating new sessions when it doesn't need to. Could you post some of your code so it can be used for testing and debugging?
The 'expire time' from my previous message will cause Oracle to drop dead connections. Just make sure that you don't set it too low, or your non-PHP database clients may be disconnected too soon as well.
Performance tuning Oracle is some where between an art form and a science. When you add in OS and network tuning to the mix, it can get really hairy really fast even for a skilled DBA.
-- Michael
Darkstreak Computing & Innovations
www.darkstreak.com