[ 
https://issues.apache.org/jira/browse/COUCHDB-743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Jyrki Pulliainen updated COUCHDB-743:
-------------------------------------

    Description: 
When using HTTP PUT to store attachments the request takes exactly one second 
to finish when the attachment size is 1025 bytes or more. This behaviour does 
not occur with inline attachments.

Here's a bash script to reproduce the behaviour (requires curl and python >= 
2.6)

#!/bin/sh

size=1025

curl -X DELETE http://localhost:5984/test
curl -X PUT http://localhost:5984/test

docid=0
while true; do
    rev=`curl -s -X PUT http://localhost:5984/test/$docid --data-binary '{}' | 
python -c "import json; import sys; print json.load(sys.stdin)['rev']"`
    echo -n "start:"; date '+%H:%M:%S.%N'
    head -c $size /dev/urandom | curl -s -X PUT -H 'Content-Type: text/plain' 
http://localhost:5984/test/$docid/attachment\?rev=$rev --data-binary @-
    echo -n "end:"; date '+%H:%M:%S.%N'
    docid=$(($docid+1))
done

  was:
#!/bin/sh

size=1025
When using HTTP PUT to store attachments the request takes exactly one second 
to finish when the attachment size is 1025 bytes or more. This behaviour does 
not occur with inline attachments.

Here's a bash script to reproduce the behaviour (requires curl and python >= 
2.6)

#!/bin/sh

size=1025

curl -X DELETE http://localhost:5984/test
curl -X PUT http://localhost:5984/test

docid=0
while true; do
    rev=`curl -s -X PUT http://localhost:5984/test/$docid --data-binary '{}' | 
python -c "import json; import sys; print json.load(sys.stdin)['rev']"`
    echo -n "start:"; date '+%H:%M:%S.%N'
    head -c $size /dev/urandom | curl -s -X PUT -H 'Content-Type: text/plain' 
http://localhost:5984/test/$docid/attachment\?rev=$rev --data-binary @-
    echo -n "end:"; date '+%H:%M:%S.%N'
    docid=$(($docid+1))
done


> Sending attachments via new HTTP API is slow if attachment size is bigger 
> than 1024 bytes
> -----------------------------------------------------------------------------------------
>
>                 Key: COUCHDB-743
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-743
>             Project: CouchDB
>          Issue Type: Bug
>          Components: Database Core, HTTP Interface
>    Affects Versions: 0.10, 0.10.1
>         Environment: Ubuntu Karmic (9.10) with CouchDB 0.10.0. According to 
> IRC conversations, also reproduced with 0.10.1
>            Reporter: Jyrki Pulliainen
>
> When using HTTP PUT to store attachments the request takes exactly one second 
> to finish when the attachment size is 1025 bytes or more. This behaviour does 
> not occur with inline attachments.
> Here's a bash script to reproduce the behaviour (requires curl and python >= 
> 2.6)
> #!/bin/sh
> size=1025
> curl -X DELETE http://localhost:5984/test
> curl -X PUT http://localhost:5984/test
> docid=0
> while true; do
>     rev=`curl -s -X PUT http://localhost:5984/test/$docid --data-binary '{}' 
> | python -c "import json; import sys; print json.load(sys.stdin)['rev']"`
>     echo -n "start:"; date '+%H:%M:%S.%N'
>     head -c $size /dev/urandom | curl -s -X PUT -H 'Content-Type: text/plain' 
> http://localhost:5984/test/$docid/attachment\?rev=$rev --data-binary @-
>     echo -n "end:"; date '+%H:%M:%S.%N'
>     docid=$(($docid+1))
> done

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to