PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
  #1  
Old August 15th, 2002, 10:49 PM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
Maximum Array Size

I am writing a script for a corporate email list. I was going to load all the email addresses into an array.

How much information can be in an array and is there a disadvantage with speed and cpu/memory load?

Thanks,

Reply With Quote
  #2  
Old August 15th, 2002, 11:04 PM
notepad notepad is offline
Codewalkers Loyal (3000 - 3499 posts)
 
Join Date: Apr 2007
Location: Central, IL USA
Posts: 3,214 notepad User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Send a message via AIM to notepad
RE: Maximum Array Size

obviously the more data that's stored in something - the longer it's going to take to process..

i'm not aware of any set limit restrictions on arrays.

Reply With Quote
  #3  
Old August 16th, 2002, 02:15 AM
Gipz Gipz is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Stockholm, Sweden
Posts: 98 Gipz User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to Gipz
RE: Maximum Array Size

Are the email addresses stored in a database?

Then you could load say 100 email into an array, mail them, load the next 100 from the db and so on. This aproach would work on a file too. Don't know if you gain preformance - it was just a thought.

Reply With Quote
  #4  
Old August 16th, 2002, 04:24 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Maximum Array Size

no, there is not a "limit" for array size, and u shouldn't worry too much about cpu/mem load, because php uses very good hash algorithm for arrays...

u should wory more about a mail server, as i don't think it will like it if you send thausnds of emails in one script run...

at least, do a sleep() of about 5 seconds after some 20-30 emails sent... (u may try other pauses/nombers of emails)...

Reply With Quote
  #5  
Old August 17th, 2002, 10:27 PM
CmdrDats CmdrDats is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: <br><img src='http://www.dats.co.za/icon.gif'>
Posts: 269 CmdrDats User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
Send a message via ICQ to CmdrDats Send a message via AIM to CmdrDats Send a message via Yahoo to CmdrDats
RE: Maximum Array Size

The maximum size of the array depends on the amoun of memory that php is allowed to saturate, but you can usually stick a couple of thousand values into an array without much hassle.. be slow though..

as zombie mentioned, trying to send this through all at the same time is going to kill your mail server. My solution for the problem is simply to queue it in another table and have a script that gets run every 2-5 minutes (cron) and sends of 10-100 emails at a time..

Reply With Quote
  #6  
Old August 18th, 2002, 01:02 AM
jorgen jorgen is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Location: Hardenberg, Holland<marquee>
Posts: 284 jorgen User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 2
RE: Maximum Array Size

An array is only a list of pointers, if you are familiar to C you know what pointers are...
So is a string an array of characters...

I.E.

$string = "Something";
echo $string[0]; // Echo S
echo $string[1]; // Echo o
echo $string[2]; // Echo m


Reply With Quote
  #7  
Old August 18th, 2002, 01:31 AM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Maximum Array Size

I do not want to make sendmail 'Puke'. My current machine is a quad zeon 550 with a gig of ram. It's a pretty speedy cow. We are currently doing it with sleep as Zombie mentioned and it seems to be stable.

Thanks To ALL!

Reply With Quote
  #8  
Old August 18th, 2002, 02:31 AM
zombie zombie is offline
Codewalkers Intermediate (1500 - 1999 posts)
 
Join Date: Apr 2007
Location: serbia
Posts: 1,876 zombie User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
RE: Maximum Array Size

yes, that is a pretty speedy comp, but don't forget that your cow calls other cows ;)(that are not as speedy) to send those emails...

btw, how much emails are we talking about? ;)

Reply With Quote
  #9  
Old August 18th, 2002, 03:28 AM
postalcow postalcow is offline
Codewalkers Beginner (1000 - 1499 posts)
 
Join Date: Apr 2007
Location: Ford CIty, PA USA
Posts: 1,267 postalcow User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 3
Send a message via Yahoo to postalcow
RE: Maximum Array Size

Zombie,

Were talking about 3000+ Customers in the list. Not an extremely huge amount.

All my cows are speedy they exercise regularly.

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > Maximum Array Size


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT