Re: [PHP] Sessions running out of storage space - Increase memory?
Dan wrote: I need to retrieve a huge amount of data form a database and do so many times. To eliminate the overhead of connecting to the database and pulling down all that info over and over, I'm trying to pull it down only once and stick it into a session. The problem is I get the first few results and everything works fine. But then after those first 5 or so I only get 0's. My first thought is that this is because of a limit on memory that sessions can take up or file size/space where the sessions are stored. I looked in the PHP.INI and I didn't find anything though. Any ideas on how to fix this problem or a more elegant solution to my huge data needs? - Dan APC? apc_store('some_array',serialize($some_array),86400); caches $some_array in RAM for 24 hours. $some_array = unserialize(apc_fetch('some_array')); brings it back out. Note - don't do this if you're dealing with massive amounts of data unique to each session_id, though. Come to think of it... if you're dealing with massive amounts of data for each session_id, that might be part of your problem. :) Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions running out of storage space - Increase memory?
It's already in an array format. I don't remember off the top of my head but there's some function like resultsarray which turns the resutls into an array. I'm already storing the array in the session. John A DAVIS [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] stick in in an array in a session Dan [EMAIL PROTECTED] 10/3/2007 2:21 PM I need to retrieve a huge amount of data form a database and do so many times. To eliminate the overhead of connecting to the database and pulling down all that info over and over, I'm trying to pull it down only once and stick it into a session. The problem is I get the first few results and everything works fine. But then after those first 5 or so I only get 0's. My first thought is that this is because of a limit on memory that sessions can take up or file size/space where the sessions are stored. I looked in the PHP.INI and I didn't find anything though. Any ideas on how to fix this problem or a more elegant solution to my huge data needs? - Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions running out of storage space - Increase memory?
Dan wrote: After thinking about this a while I also thought of making my own cache. The problem with that is would it be any faster or have any less strain on the server than having multiple requests/connections to the database? A lot depends on the amount of data and the overall load on the web-server. If you do the query once, then store the result in a file, and then keep reading that file for the next cachetime seconds, the file will most probably remain in memory, so accessing it will be fast and without IO. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Sessions running out of storage space - Increase memory?
I need to retrieve a huge amount of data form a database and do so many times. To eliminate the overhead of connecting to the database and pulling down all that info over and over, I'm trying to pull it down only once and stick it into a session. The problem is I get the first few results and everything works fine. But then after those first 5 or so I only get 0's. My first thought is that this is because of a limit on memory that sessions can take up or file size/space where the sessions are stored. I looked in the PHP.INI and I didn't find anything though. Any ideas on how to fix this problem or a more elegant solution to my huge data needs? - Dan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions running out of storage space - Increase memory?
Dan wrote: I need to retrieve a huge amount of data form a database and do so many times. To eliminate the overhead of connecting to the database and pulling down all that info over and over, I'm trying to pull it down only once and stick it into a session. The problem is I get the first few results and everything works fine. But then after those first 5 or so I only get 0's. My first thought is that this is because of a limit on memory that sessions can take up or file size/space where the sessions are stored. I looked in the PHP.INI and I didn't find anything though. Any ideas on how to fix this problem or a more elegant solution to my huge data needs? IF there is a problem in using session storage, you could just use your own file cache instead. Or you could the database query cache, depending on how much data you're talking about. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions running out of storage space - Increase memory?
After thinking about this a while I also thought of making my own cache. The problem with that is would it be any faster or have any less strain on the server than having multiple requests/connections to the database? - Dan Per Jessen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dan wrote: I need to retrieve a huge amount of data form a database and do so many times. To eliminate the overhead of connecting to the database and pulling down all that info over and over, I'm trying to pull it down only once and stick it into a session. The problem is I get the first few results and everything works fine. But then after those first 5 or so I only get 0's. My first thought is that this is because of a limit on memory that sessions can take up or file size/space where the sessions are stored. I looked in the PHP.INI and I didn't find anything though. Any ideas on how to fix this problem or a more elegant solution to my huge data needs? IF there is a problem in using session storage, you could just use your own file cache instead. Or you could the database query cache, depending on how much data you're talking about. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions running out of storage space - Increase memory?
Does the data change often? If not you could just enable query cache and cache connection threads and you'd probably be fine. Dan wrote: After thinking about this a while I also thought of making my own cache. The problem with that is would it be any faster or have any less strain on the server than having multiple requests/connections to the database? - Dan Per Jessen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dan wrote: I need to retrieve a huge amount of data form a database and do so many times. To eliminate the overhead of connecting to the database and pulling down all that info over and over, I'm trying to pull it down only once and stick it into a session. The problem is I get the first few results and everything works fine. But then after those first 5 or so I only get 0's. My first thought is that this is because of a limit on memory that sessions can take up or file size/space where the sessions are stored. I looked in the PHP.INI and I didn't find anything though. Any ideas on how to fix this problem or a more elegant solution to my huge data needs? IF there is a problem in using session storage, you could just use your own file cache instead. Or you could the database query cache, depending on how much data you're talking about. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions running out of storage space - Increase memory?
The data doesn't change often but the querys do. Thats why I was origionally thinking of just storing the entire result in a session and just use the part of the session I needed. So caching wouldn't really work. That was something intresting though that I didn't know earlier thanks! - Dan Gary Josack [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Does the data change often? If not you could just enable query cache and cache connection threads and you'd probably be fine. Dan wrote: After thinking about this a while I also thought of making my own cache. The problem with that is would it be any faster or have any less strain on the server than having multiple requests/connections to the database? - Dan Per Jessen [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Dan wrote: I need to retrieve a huge amount of data form a database and do so many times. To eliminate the overhead of connecting to the database and pulling down all that info over and over, I'm trying to pull it down only once and stick it into a session. The problem is I get the first few results and everything works fine. But then after those first 5 or so I only get 0's. My first thought is that this is because of a limit on memory that sessions can take up or file size/space where the sessions are stored. I looked in the PHP.INI and I didn't find anything though. Any ideas on how to fix this problem or a more elegant solution to my huge data needs? IF there is a problem in using session storage, you could just use your own file cache instead. Or you could the database query cache, depending on how much data you're talking about. /Per Jessen, Zürich -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Sessions running out of storage space - Increase memory?
stick in in an array in a session "Dan" [EMAIL PROTECTED] 10/3/2007 2:21 PM I need to retrieve a huge amount of data form a database and do so many times. To eliminate the overhead of connecting to the database and pulling down all that info over and over, I'm trying to pull it down only once and stick it into a session. The problem is I get the first few results and everything works fine. But then after those first 5 or so I only get 0's. My first thought is that this is because of a limit on memory that sessions can take up or file size/space where the sessions are stored. I looked in the PHP.INI and I didn't find anything though.Any ideas on how to fix this problem or a more elegant solution to my huge data needs?- Dan -- PHP General Mailing List (http://www.php.net/)To unsubscribe, visit: http://www.php.net/unsub.php