I am experimenting with GAE for last 2 Months.
I am saving records to the bigtable by uploading CSV file.
My Test File's size is 300 KB.
Here what i found
Local system
- Upload take less than 1 second
- Process 2500 records in 3 seconds
On Google Sandbox
Upload takes 5-7 seconds.
Processing file gives timeout.
It only save 60-180 records.
My questions are
- Why it takes too much time?
- Is there a way to reduce this time?
- Google counts this processing towards CPU uses. They do not disclose h/w so what CPU internally they use? I mean do i get a CPU euquivalent or greater than PIII?
Edited for @Drew Sears's answer.
What i am doing at present
- Upload the file to GAE
- Get uploaded data bytes. By stream, count lines , save it into bigtable.
- There is a unique field, id, my Record.
- Now, i create queue
int x = linesCount/ 50;
for(int i<0;i=x;i++)
{
x = i * 50;
Queue queue = QueueFactory.getQueue("test-queue");
queue.add(TaskOptions.Builder.url("/TestQueue")
.param("id", id.toString())
.param("startIdx",String.valueOf(x))
.param("totRec",String.valueOf(50))
);
}
int y = linesCount % 50;
if( y > 0 )
{
x = (linesCount / 50) * 50;
Queue queue = QueueFactory.getQueue("test-queue");
queue.add(TaskOptions.Builder.url("/TestQueue")
.param("id", id.toString())
.param("startIdx",String.valueOf(x))
.param("totRec",String.valueOf(y))
);
}
The task processing servlet read file from storage and using totRec and startIdx process the file and close it..