Welcome to WebmasterWorld Guest from 107.20.75.63

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Server friendly array iteration...

     
3:49 am on Jun 25, 2004 (gmt 0)

Full Member

10+ Year Member

joined:Apr 8, 2004
posts:215
votes: 0


I'm having some trouble keeping my server alive when iterating through huge arrays to put data in a database. Is there anything less cpu intensive than a simple count and for loop?
3:45 pm on June 25, 2004 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


what size arrays are we talkin?
what are you doing that makes the monster arrays necessary?
is there a way to split the work so that you can dump the data into the db earlier instead of making the whole array?
4:20 pm on June 25, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:June 3, 2004
posts:55
votes: 0


The problem is more likely a lack of ram and needing to use swap file that is killing you.

Also use ( unset($var); ) get rid of unneeded vars and free ram.