RE: [PHP] How Much Data Can Be Written to a Database In One Instance?
| From: | Alice Wei | Date: | Wed, 04 Mar 2009 20:30:57 +0000 |
| Subject: | RE: [PHP] How Much Data Can Be Written to a Database In One Instance? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-289274@lists.php.net to get a copy of this message | ||
> Subject: Re: [PHP] How Much Data Can Be Written to a Database In One Instance?
> From: robert@interjinn.com
> To: ajwei@alumni.iu.edu
> CC: php-general@lists.php.net
> Date: Wed, 4 Mar 2009 15:26:38 -0500
>
> On Wed, 2009-03-04 at 15:05 -0500, Alice Wei wrote:
> > Hi,
> >
> > I am working on a series of long files that contain 4 or 5 MB each, each of them is
> > encoded in UTF-8 saved as .dat format.
> > However, I have noticed that when I do insert statements, the file only reads up to
> > around 1MB and then would stop. If I split the file into 3 or 4 files, that would hold no more than
> > 1.2 MB each, then I won't have problems.
> >
> > Is there a limitation on how much data can be read and written in PHP within one
> > instance?
>
> See this setting in your php.ini:
>
> memory_limit = ???M
>
> Cheers,
> Rob.
> --
> http://www.interjinn.com
> Application and Templating Framework for PHP
>
Weird, I had
memory_limit = 128M ; Maximum amount of memory a script may consume (128MB)
However, the file that I was trying to read from was 5MB of text file. I tried to read it line by
line and also ran one query for each line along the way before I got it to the database. If I have a
file that is around 1MB, I have no problems, but once it passes that, a lot of lines go missing.
Alice
_________________________________________________________________
Check the weather nationwide with MSN Search: Try it now!
http://search.msn.com/results.aspx?q=weather&FORM=WLMTAG