Thanks. No problems with tempnam, but I'm capacity planning for what is 
likely to be a heavily loaded site with many users hitting simultaneously. 
I want to avoid (or plan for) a situation where there is no spare memory in 
a particular instance for another temp file to be created because it's 
serving so many other users at the same time. I'm not sure if this is a 
likely scenario or not because I don't know what the potential temp folder 
capacity is and the maximum users one instance is likely to be serving 
simultaneously.

Current strategy is to try and create a temp file in vfs:// and if that 
fails create one in Cloud Storage - but is it suitable for that kind of 
momentary usage and would I incur significant cost (I realise no cost for 
bandwidth if in the same region) or what's the minimum cost for each 
momentary usage of Cloud Storage - is it billed by the second, hour or day? 
(i.e. if used for 1 second, I get billed for a day?)

Many thanks,
Alex


On Sunday, June 14, 2015 at 11:22:13 PM UTC+1, Stuart Langley wrote:
>
> Have you tried using tempnam 
> <http://php.net/manual/en/function.tempnam.php>? If so, what problems did 
> you see? That seems to be the obvious solution.
>
> On Sunday, 14 June 2015 05:11:03 UTC+10, Alex Kerr wrote:
>>
>> Hi,
>>
>> What's generally accepted wisdom/tech solution for temp files on GAE 
>> using PHP, please?
>>
>> I need to store and process an image (a few hundred K in size) using PHP 
>> that momentarily (e.g. < 1 second) needs to exist as a temp file somewhere 
>> before it's sent on elsewhere and the temp file can be deleted. My site 
>> will need to autoscale for potentially large numbers of users (using GAE as 
>> standard) - i.e. so site may need to be doing this for many users 
>> simultaneously (all for different images) on however many GAE instances are 
>> running.
>>
>> My idea was to attempt to store the temp file in memory (using tempnam() 
>> etc) and if that failed (e.g. mem full on that instance), immediately try 
>> and use some other storage instead on the fly. Question is what? Image has 
>> to be available as a file for CURL to access it (I think?) and send 
>> elsewhere, so Memcache is not an option (can't access the data as a file to 
>> pass into CURL - or can I?), but e.g. Cloud Storage is (via 
>> 'gs://[bucket-name]/...'). Thing is, if I've just written the file to 
>> storage, is it immediately available for reading? That's also a significant 
>> cost incurred... Or Cloud Datastore? But again is file available for 
>> reading immediately, and is there a file wrapper for access...?
>>
>> Any help much appreciated!
>>
>> Thanks,
>> Alex
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-appengine+unsubscr...@googlegroups.com.
To post to this group, send email to google-appengine@googlegroups.com.
Visit this group at http://groups.google.com/group/google-appengine.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-appengine/28f8c178-e7ef-40e8-a7da-8c130f2e0fe3%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to