Ask Your Question

PUT cost a lot of time

asked 2013-08-02 15:55:28 -0600

249524324-q gravatar image

When I put a large number of 4K files, the performance is terrible.

My testing configuration: [bench] concurrency = 200 object_size = 4096 num_objects = 200000 num_containers = 200

Now I trace the code of PUT operation and find some problems. I seem looks like that three step will cost a lot of time in PUT operation.

in function "ObjectController::PUT":

for chunk in iter(lambda: reader(self.network_chunk_size), ''): upload_size += len(chunk) if time.time() > upload_expiration: self.logger.increment('PUT.timeouts') return HTTPRequestTimeout(request=request) etag.update(chunk) while chunk: written = os.write(fd, chunk) chunk = chunk[written:] sleep()

per lambda:reader will cost 600ms when I put 4K files. And also eventlet.sleep() will cost 400ms. At last, fsync() and async_update() will const 400ms.

Is there anyone who had faced this problem? How to fix this issue?

edit retag flag offensive close merge delete

12 answers

Sort by ยป oldest newest most voted

answered 2013-08-02 20:14:09 -0600

249524324-q gravatar image

Thank you for your help.But I think it does not seem to be a good idea that holding on current request to running another greenlet.The proxy will cost longer time to wait the response because request be holding on.I don't understand why swift does sleep the current greenlet.

edit flag offensive delete link more

answered 2013-08-02 18:52:57 -0600

torgomatic gravatar image

The reader is what's pulling data off the network. That's expected to take a long time.

The fsync() and async_update() will take a long time because they're doing a bunch of disk IO. fsync() makes sure any data in buffer cache is written out to disk, so if that's taking a while, it's because that call makes a bunch of disk heads move around and wait for spinning platters.

eventlet.sleep() may take a while, but that's because it's yielding to another greenlet. The only way the timing measurement there will accurately measure the eventlet overhead is if you have exactly one request being processed. Otherwise, what looks like wasted time is actually time that is spent on running another greenlet.

edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-08-02 15:55:28 -0600

Seen: 172 times

Last updated: Aug 12 '13