You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by David Luu <ma...@gmail.com> on 2012/08/21 02:33:16 UTC

What is best approach to design this kind of test?

I may have need to design a test for benchmarking our photo upload
architecture at my organization. Here's how the photo uploads from browser
work:

client selects multiple photos for HTML5 based multiple file upload element
(single browse button w/ multiple file select option).
on file upload element set with value(s), we use AJAX request to server to
set up photo endpoints. It's a single HTTP GET request where we get back
response that tells client side code where to upload the selected photo(s).
The client then performs multiple file uploads (HTTP POSTs) in parallel
(limited to 3 at a time by browser architecture).

Would like to simulate this and scale up user count, assuming the average
user selects say 3 photos to upload at same time. A thread group will scale
the user count, but how do I perform HTTP sample requests in concurrently
rather than serially in a thread group? I notice you can't do a thread
group within thread group. I did notice that there is test fragment option
that allows you to use samplers outside thread group, but that part won't
scale beyond one user it seems. So how would I put this test together? Or
will I have to make do with serial uploads with concurrent requests within
a single user/thread not possible?

Thanks in advance,
David

Re: What is best approach to design this kind of test?

Posted by Adrian Speteanu <as...@gmail.com>.
HTTP Post can be multi-part. Therefore, you upload multiple files (and
other data) at the same time (a single request, multiple text parts).
Please check and make sure this is the case. Otherwise making concurrent
http requests (of whatever method) using the same session ID is tricky and
can't be done with a single thread. However I doubt it is the case.

Regards,
--Adrian S

On Tue, Aug 21, 2012 at 3:33 AM, David Luu <ma...@gmail.com> wrote:

> I may have need to design a test for benchmarking our photo upload
> architecture at my organization. Here's how the photo uploads from browser
> work:
>
> client selects multiple photos for HTML5 based multiple file upload element
> (single browse button w/ multiple file select option).
> on file upload element set with value(s), we use AJAX request to server to
> set up photo endpoints. It's a single HTTP GET request where we get back
> response that tells client side code where to upload the selected photo(s).
> The client then performs multiple file uploads (HTTP POSTs) in parallel
> (limited to 3 at a time by browser architecture).
>
> Would like to simulate this and scale up user count, assuming the average
> user selects say 3 photos to upload at same time. A thread group will scale
> the user count, but how do I perform HTTP sample requests in concurrently
> rather than serially in a thread group? I notice you can't do a thread
> group within thread group. I did notice that there is test fragment option
> that allows you to use samplers outside thread group, but that part won't
> scale beyond one user it seems. So how would I put this test together? Or
> will I have to make do with serial uploads with concurrent requests within
> a single user/thread not possible?
>
> Thanks in advance,
> David
>

Re: What is best approach to design this kind of test?

Posted by Deepak Shetty <sh...@gmail.com>.
>The session is only needed for the initial call to set up the receiving
endpoints,
Ok then the technique in the blog post should work(inefficient though) -
though you still need to share data between threads - the URLs. i'd
probably just use a property that has the thread number suffixed (url_1,
url_2.. url_4 etc) and each thread just uses its property.

regards
deepak

On Tue, Aug 21, 2012 at 10:45 AM, David Luu <ma...@gmail.com> wrote:

> Thanks for input Deepak and Adrian. I'll look into your suggestions.
>
> I had considered option of 1 user uploading 3 files vs 3 users uploading 1
> file, but thought I'd ask about simulating as closely the real world usage.
> I'll follow up internally but assume it shouldn't make much difference load
> wise going either way, though it will be testing a slightly different path
> as the DB and file association to user will be set differently.
>
> To clarify some questions:
>
> The session is only needed for the initial call to set up the receiving
> endpoints, the parallel uploads go to a different domain and don't require
> session. They make use of authentication token embedded in the URLs of the
> endpoints that will receive the files, that were returned in the response
> from the setup call. These also are separate HTTP POSTs, not a multi-part
> POST, as the files go to 3 different URLs, and you see 3 requests in
> Firebug.
>
> David
>
> On Tue, Aug 21, 2012 at 8:53 AM, Deepak Shetty <sh...@gmail.com> wrote:
>
> > the main question for you to answer is
> > Is there any difference between 1 user uploading 3 files in parallel and
> 3
> > users uploading 1 file in parallel (atleast from what the server sees)
> > That's something a developer may be able to answer - but developers are
> > notoriously bad at predicting stuff like this and sometimes you are
> running
> > this test to figure out the answer to the question above.
> >
> > Option 1 is write a java sampler that can upload files 3 threads at a
> time
> > and use this
> > Option 2 go through the source code for JMeter where they allowed thread
> > pooling for download embedded resources and make it work for your use
> case
> > (not sure what the status is - it was introduced and then recommended not
> > to use it , not sure what the current status is)
> > Option 3
> >
> http://theworkaholic.blogspot.com/2010/11/jmeter-and-ajax-part-iii.html(and
> > if you need session information then there is stuff needed to be added
> > here)
> >
> > regards
> > deepak
> >
> >
> >
> > On Mon, Aug 20, 2012 at 5:33 PM, David Luu <ma...@gmail.com> wrote:
> >
> > > I may have need to design a test for benchmarking our photo upload
> > > architecture at my organization. Here's how the photo uploads from
> > browser
> > > work:
> > >
> > > client selects multiple photos for HTML5 based multiple file upload
> > element
> > > (single browse button w/ multiple file select option).
> > > on file upload element set with value(s), we use AJAX request to server
> > to
> > > set up photo endpoints. It's a single HTTP GET request where we get
> back
> > > response that tells client side code where to upload the selected
> > photo(s).
> > > The client then performs multiple file uploads (HTTP POSTs) in parallel
> > > (limited to 3 at a time by browser architecture).
> > >
> > > Would like to simulate this and scale up user count, assuming the
> average
> > > user selects say 3 photos to upload at same time. A thread group will
> > scale
> > > the user count, but how do I perform HTTP sample requests in
> concurrently
> > > rather than serially in a thread group? I notice you can't do a thread
> > > group within thread group. I did notice that there is test fragment
> > option
> > > that allows you to use samplers outside thread group, but that part
> won't
> > > scale beyond one user it seems. So how would I put this test together?
> Or
> > > will I have to make do with serial uploads with concurrent requests
> > within
> > > a single user/thread not possible?
> > >
> > > Thanks in advance,
> > > David
> > >
> >
>

Re: What is best approach to design this kind of test?

Posted by David Luu <ma...@gmail.com>.
Thanks for input Deepak and Adrian. I'll look into your suggestions.

I had considered option of 1 user uploading 3 files vs 3 users uploading 1
file, but thought I'd ask about simulating as closely the real world usage.
I'll follow up internally but assume it shouldn't make much difference load
wise going either way, though it will be testing a slightly different path
as the DB and file association to user will be set differently.

To clarify some questions:

The session is only needed for the initial call to set up the receiving
endpoints, the parallel uploads go to a different domain and don't require
session. They make use of authentication token embedded in the URLs of the
endpoints that will receive the files, that were returned in the response
from the setup call. These also are separate HTTP POSTs, not a multi-part
POST, as the files go to 3 different URLs, and you see 3 requests in
Firebug.

David

On Tue, Aug 21, 2012 at 8:53 AM, Deepak Shetty <sh...@gmail.com> wrote:

> the main question for you to answer is
> Is there any difference between 1 user uploading 3 files in parallel and 3
> users uploading 1 file in parallel (atleast from what the server sees)
> That's something a developer may be able to answer - but developers are
> notoriously bad at predicting stuff like this and sometimes you are running
> this test to figure out the answer to the question above.
>
> Option 1 is write a java sampler that can upload files 3 threads at a time
> and use this
> Option 2 go through the source code for JMeter where they allowed thread
> pooling for download embedded resources and make it work for your use case
> (not sure what the status is - it was introduced and then recommended not
> to use it , not sure what the current status is)
> Option 3
> http://theworkaholic.blogspot.com/2010/11/jmeter-and-ajax-part-iii.html(and
> if you need session information then there is stuff needed to be added
> here)
>
> regards
> deepak
>
>
>
> On Mon, Aug 20, 2012 at 5:33 PM, David Luu <ma...@gmail.com> wrote:
>
> > I may have need to design a test for benchmarking our photo upload
> > architecture at my organization. Here's how the photo uploads from
> browser
> > work:
> >
> > client selects multiple photos for HTML5 based multiple file upload
> element
> > (single browse button w/ multiple file select option).
> > on file upload element set with value(s), we use AJAX request to server
> to
> > set up photo endpoints. It's a single HTTP GET request where we get back
> > response that tells client side code where to upload the selected
> photo(s).
> > The client then performs multiple file uploads (HTTP POSTs) in parallel
> > (limited to 3 at a time by browser architecture).
> >
> > Would like to simulate this and scale up user count, assuming the average
> > user selects say 3 photos to upload at same time. A thread group will
> scale
> > the user count, but how do I perform HTTP sample requests in concurrently
> > rather than serially in a thread group? I notice you can't do a thread
> > group within thread group. I did notice that there is test fragment
> option
> > that allows you to use samplers outside thread group, but that part won't
> > scale beyond one user it seems. So how would I put this test together? Or
> > will I have to make do with serial uploads with concurrent requests
> within
> > a single user/thread not possible?
> >
> > Thanks in advance,
> > David
> >
>

Re: What is best approach to design this kind of test?

Posted by Deepak Shetty <sh...@gmail.com>.
the main question for you to answer is
Is there any difference between 1 user uploading 3 files in parallel and 3
users uploading 1 file in parallel (atleast from what the server sees)
That's something a developer may be able to answer - but developers are
notoriously bad at predicting stuff like this and sometimes you are running
this test to figure out the answer to the question above.

Option 1 is write a java sampler that can upload files 3 threads at a time
and use this
Option 2 go through the source code for JMeter where they allowed thread
pooling for download embedded resources and make it work for your use case
(not sure what the status is - it was introduced and then recommended not
to use it , not sure what the current status is)
Option 3
http://theworkaholic.blogspot.com/2010/11/jmeter-and-ajax-part-iii.html(and
if you need session information then there is stuff needed to be added
here)

regards
deepak



On Mon, Aug 20, 2012 at 5:33 PM, David Luu <ma...@gmail.com> wrote:

> I may have need to design a test for benchmarking our photo upload
> architecture at my organization. Here's how the photo uploads from browser
> work:
>
> client selects multiple photos for HTML5 based multiple file upload element
> (single browse button w/ multiple file select option).
> on file upload element set with value(s), we use AJAX request to server to
> set up photo endpoints. It's a single HTTP GET request where we get back
> response that tells client side code where to upload the selected photo(s).
> The client then performs multiple file uploads (HTTP POSTs) in parallel
> (limited to 3 at a time by browser architecture).
>
> Would like to simulate this and scale up user count, assuming the average
> user selects say 3 photos to upload at same time. A thread group will scale
> the user count, but how do I perform HTTP sample requests in concurrently
> rather than serially in a thread group? I notice you can't do a thread
> group within thread group. I did notice that there is test fragment option
> that allows you to use samplers outside thread group, but that part won't
> scale beyond one user it seems. So how would I put this test together? Or
> will I have to make do with serial uploads with concurrent requests within
> a single user/thread not possible?
>
> Thanks in advance,
> David
>