|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
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, |
|
#2
|
|||
|
|||
|
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. |
|
#3
|
|||
|
|||
|
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. |
|
#4
|
|||
|
|||
|
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)... |
|
#5
|
|||
|
|||
|
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.. |
|
#6
|
|||
|
|||
|
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 |
|
#7
|
|||
|
|||
|
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! |
|
#8
|
|||
|
|||
|
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? ;) |
|
#9
|
|||
|
|||
|
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. |
![]() |
| Viewing: Codewalkers Forums > PHP Related > PHP Coding > Maximum Array Size |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|