users@grizzly.java.net

Re: any way to make this faster/more scalable?

From: Jon Brisbin <jon_at_jbrisbin.com>
Date: Tue, 26 Jul 2011 17:09:23 -0500 (CDT)

I did try that, but it didn't seem to make any difference w.r.t. run times.

I've actually decreased the value some as that makes it more scalable. I've uploaded a 1GB file so far and that only takes a couple seconds, even though memory usage goes through the roof.

Should the readBufferSize match the size I give notifyAvailable() (e.g. should I try to keep them in sync, or can they be different)?

Thanks!

Jon Brisbin
http//jbrisbin.com

----- Original Message -----

> From: "Ryan Lubke" <ryan.lubke_at_oracle.com>
> To: users_at_grizzly.java.net
> Sent: Tuesday, July 26, 2011 4:20:31 PM
> Subject: Re: any way to make this faster/more scalable?

> On 7/26/11 11:02 AM, Jon Brisbin wrote:
> > Can I change the readBufferSize based on Content-Length? This is
> > really the question: is there any way (besides eliminating the
> > buffer copy) to make this faster or more scalable?
>

> > https://github.com/jbrisbin/node-vs-java-shootout/blob/master/src/main/groovy/shootout/UploadHandler.groovy
>

> > It does fine now up to >100MB. But trying to upload a 1GB file is
> > killing my CPU (GC maybe?). Just wondered if there aren't some
> > micro-optimizations I can make to shave a few microseconds off here
> > or there.
>

> Have you tried decreasing the number of file writes you're performing
> (i.e., increase the value for the number of bytes that must be
> received before invoking the ReadHandler callbacks)?

> > Thanks!
>

> > Jon Brisbin
>
> > http//jbrisbin.com
>