simpleweb-support Mailing List for Simple (Page 18)
Brought to you by:
niallg
You can subscribe to this list here.
2004 |
Jan
(1) |
Feb
(4) |
Mar
(2) |
Apr
(14) |
May
(22) |
Jun
(15) |
Jul
(9) |
Aug
(2) |
Sep
(7) |
Oct
(4) |
Nov
(2) |
Dec
(12) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(7) |
Feb
(16) |
Mar
(17) |
Apr
|
May
(12) |
Jun
(4) |
Jul
(22) |
Aug
(50) |
Sep
(8) |
Oct
(23) |
Nov
(9) |
Dec
(50) |
2006 |
Jan
(6) |
Feb
(7) |
Mar
(8) |
Apr
(3) |
May
(13) |
Jun
(4) |
Jul
(2) |
Aug
|
Sep
(1) |
Oct
|
Nov
(6) |
Dec
(7) |
2007 |
Jan
(11) |
Feb
(3) |
Mar
(17) |
Apr
(21) |
May
(9) |
Jun
(4) |
Jul
(6) |
Aug
(1) |
Sep
|
Oct
(8) |
Nov
(14) |
Dec
(3) |
2008 |
Jan
(3) |
Feb
|
Mar
|
Apr
(5) |
May
|
Jun
|
Jul
(4) |
Aug
(4) |
Sep
(15) |
Oct
(9) |
Nov
(6) |
Dec
(2) |
2009 |
Jan
(29) |
Feb
(2) |
Mar
(8) |
Apr
(14) |
May
(4) |
Jun
(13) |
Jul
(5) |
Aug
|
Sep
|
Oct
(4) |
Nov
(3) |
Dec
(7) |
2010 |
Jan
|
Feb
(2) |
Mar
(61) |
Apr
(9) |
May
(10) |
Jun
(9) |
Jul
(10) |
Aug
(7) |
Sep
(15) |
Oct
(5) |
Nov
(2) |
Dec
(3) |
2011 |
Jan
(11) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(4) |
Oct
|
Nov
(6) |
Dec
(9) |
2012 |
Jan
|
Feb
(1) |
Mar
(2) |
Apr
(3) |
May
(2) |
Jun
|
Jul
(17) |
Aug
|
Sep
|
Oct
|
Nov
(10) |
Dec
(5) |
2013 |
Jan
(2) |
Feb
(4) |
Mar
|
Apr
(12) |
May
|
Jun
(5) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
(1) |
2014 |
Jan
|
Feb
(2) |
Mar
(6) |
Apr
|
May
|
Jun
(20) |
Jul
(12) |
Aug
(4) |
Sep
(3) |
Oct
(5) |
Nov
|
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2017 |
Jan
|
Feb
(2) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Richard B. <Ric...@se...> - 2007-12-18 14:33:47
|
Hi I am using a JBoss SAAJ client making requests in a simpleweb server. The requests are multipart and the content-type is a folded value. In my simple service when I inspect the headers it would seem the content-type header is truncated by several characters. I have used a 'packet sniffer' and the actual requests contains the correct information. Taking a look at the simpleweb code it would seem the request header parsing is deficient in respect to folded values. I believe the value method in the HeaderParser class should be changed to: private void value() { whitespace(); =20 value.off =3D off; value.len =3D 0; =20 for(int mark=3D 0; count < len;){ if(terminal(buf[off])) { /* CR or LF */ > for(int i =3D 1; count < len; i++){ if(buf[off] =3D=3D 10) { count++; /* skip the LF */ off++; =20 if(space(buf[off])) { value.len +=3D i; /* acount for bytes examined */ > mark +=3D i; break; /* folding line */ }=20 return; /* not a folding line */ }=20 count++; off++; } =20 } else { if(!space(buf[off])){ value.len=3D ++mark; } else { mark++; } count++; off++; =20 } } =20 } NB The lines prefixed with > have changed. =20 Prior to the change the value token length was only temporarily increased as the next line would overwrite it with the value from 'mark'. With this change mark is also increased to take into account the bytes examined and the count of bytes examined starts from 1 instead of 0. Can you tell me whether my change is valid? Cheers, Rich. |
From: Richard B. <Ric...@se...> - 2007-12-18 14:22:47
|
Hi I am using a JBoss SAAJ client making requests in a simpleweb server. The requests are multipart and the content-type is a folded value. In my simple service when I inspect the headers it would seem the content-type header is truncated by several characters. I have used a 'packet sniffer' and the actual requests contains the correct information. Taking a look at the simpleweb code it would seem the request header parsing is deficient in respect to folded values. I believe the value method in the HeaderParser class should be changed to: private void value() { whitespace(); =20 value.off =3D off; value.len =3D 0; =20 for(int mark=3D 0; count < len;){ if(terminal(buf[off])) { /* CR or LF */ > for(int i =3D 1; count < len; i++){ if(buf[off] =3D=3D 10) { count++; /* skip the LF */ off++; =20 if(space(buf[off])) { value.len +=3D i; /* acount for bytes examined */ > mark +=3D i; break; /* folding line */ }=20 return; /* not a folding line */ }=20 count++; off++; } =20 } else { if(!space(buf[off])){ value.len=3D ++mark; } else { mark++; } count++; off++; =20 } } =20 } NB The lines prefixed with > have changed. =20 Prior to the change the value token length was only temporarily increased as the next line would overwrite it with the value from 'mark'. With this change mark is also increased to take into account the bytes examined and the count of bytes examined starts from 1 instead of 0. Can you tell me whether my change is valid? Cheers, Rich. |
From: Niall G. <gal...@ya...> - 2007-11-22 21:47:10
|
Hi Paul, Ya that sounds like something that could be done pretty easily with Simple. Also you can use an XML serialization framework I have written for REST and other XML related formats, it can be found here: http://simple.sourceforge.net/ Niall --- "Paul J. Lucas" <pau...@ma...> wrote: > I want to implement a small, embedded web server > that does the > following things: > > 1. Implements a subset of WebDAV-like functionality, > i.e., GET, PUT, > DELETE, COPY, and MOVE requests. > > 2. Implements a "metadata" service that gets/puts > the metadata for > image files, e.g., a request of the form: > > GET /metadata/path/to/image.jpg > > will return the metadata of the image as an XML > document and PUT will > put it back. > > 3. Implements an "image manipulation" service driven > by various > parameters, e.g.: > > GET /image/path/to/image.jpg&maxdim=100 > > would create a smaller version of the image whose > maximum dimension is > 100 pixels. Optionally, the smaller image may be > cached on the server > at a different URL in which case the server would > responsd with a "303 > See Other" status code and the URL of the smaller > image. > > I had been looking at the Restlet framework for > doing all of this, > but, while powerful, it seems overly complicated and > doesn't have > enough documentation about the "right" way to do > things. As you may > know, Restlet requires a web server framework in top > of which to > operate. I was using Restlet on top of Simple. But > then I began to > wonder if I could do implement the stuff I need > using Simple directly > and not have to deal with the Restlet framework. > > Is this reasonable? > > - Paul > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio > 2005. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > ____________________________________________________________________________________ Never miss a thing. Make Yahoo your home page. http://www.yahoo.com/r/hs |
From: Paul J. L. <pau...@ma...> - 2007-11-19 23:30:15
|
I want to implement a small, embedded web server that does the following things: 1. Implements a subset of WebDAV-like functionality, i.e., GET, PUT, DELETE, COPY, and MOVE requests. 2. Implements a "metadata" service that gets/puts the metadata for image files, e.g., a request of the form: GET /metadata/path/to/image.jpg will return the metadata of the image as an XML document and PUT will put it back. 3. Implements an "image manipulation" service driven by various parameters, e.g.: GET /image/path/to/image.jpg&maxdim=100 would create a smaller version of the image whose maximum dimension is 100 pixels. Optionally, the smaller image may be cached on the server at a different URL in which case the server would responsd with a "303 See Other" status code and the URL of the smaller image. I had been looking at the Restlet framework for doing all of this, but, while powerful, it seems overly complicated and doesn't have enough documentation about the "right" way to do things. As you may know, Restlet requires a web server framework in top of which to operate. I was using Restlet on top of Simple. But then I began to wonder if I could do implement the stuff I need using Simple directly and not have to deal with the Restlet framework. Is this reasonable? - Paul |
From: Jeff N. <je...@ne...> - 2007-11-09 10:22:40
|
All in all I think Simple would work fine for your needs... I think you'll have a hard time finding a comparable http server with a smaller footprint (the core lib is 172Kb). The only stumbling block you might have is if you require the Servlet API, as Simple has its own, similar API. But it sounds from your email that you're pretty flexible. As far as opening the port, Simple is instantiated with standard Java Sockets, so if you can lock down Java Sockets (which I imagine you can, but I've never tried), you'll be fine. Jeff On Nov 9, 2007, at 10:24 AM, Anil Philip wrote: > I would appreciate your input as to whether SimpleWeb > server can be used for this. > ----------------- > my application will have a client and server that will > run on the user's desktop - without any user > intervention. > I was considering RMI for the server, but JavaScript > components may have difficulty calling it from > Internet Explorer. > Hence I want a simple, basic http server - simply to > parse out the request headers and handle simple > servlet calls. > > -very small footprint (less than 100Kb?), basic http > server > -auto installed from Java Web Start > -preferably written in Java to install seamlessly on > various operating systems > -low volume > > I am unsure about the security risks - the port should > not be open to others on the internet. > > Does SimpleWeb meet the above requirements? > > I would appreciate your input. > thanks, > Anil > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Anil P. <goo...@ya...> - 2007-11-09 09:24:50
|
I would appreciate your input as to whether SimpleWeb server can be used for this. ----------------- my application will have a client and server that will run on the user's desktop - without any user intervention. I was considering RMI for the server, but JavaScript components may have difficulty calling it from Internet Explorer. Hence I want a simple, basic http server - simply to parse out the request headers and handle simple servlet calls. -very small footprint (less than 100Kb?), basic http server -auto installed from Java Web Start -preferably written in Java to install seamlessly on various operating systems -low volume I am unsure about the security risks - the port should not be open to others on the internet. Does SimpleWeb meet the above requirements? I would appreciate your input. thanks, Anil __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Jeff N. <je...@ne...> - 2007-11-03 12:15:09
|
Indeed, it seems to have been removed in 2.7.3 with the introduction of MapParser. It's not critical for what I'm doing, so I think I'll stick with what I'm doing for now (which is very similar to what Kai suggested) rather than modifying Simple. But it would be nice to have this back in the 4.0 version.... maybe you can add it at the same time as handling multiple values for a single cookie name as described in my previous thread 'Safari cookie paths'. ;-) Thanks to both of you, Jeff On Nov 2, 2007, at 10:43 PM, Niall Gallagher wrote: > Hi Jeff, > > This was implemented in a previous version, if you go > back to the 2.x versions you'll see how, its a simple > couple of methods, don't know why I removed it? Ill > make sure to add it back when I get a chance to > release 4.0. > > Niall > > > --- Jeff Nichols <je...@ne...> wrote: > >> Hi all, >> >> Is there any built-in way to handle form arrays? It >> seems that >> Simple's Parameters can only handle a single value >> for a specific name. >> >> The corresponding Servlet method would be >> ServletRequest.getParameterValues(String name): >> >> > http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ >> >> > ServletRequest.html#getParameterValues(java.lang.String) >> >> Thanks, >> Jeff >> >> > ---------------------------------------------------------------------- > --- >> This SF.net email is sponsored by: Splunk Inc. >> Still grepping through log files to find problems? >> Stop. >> Now Search log events and configuration files using >> AJAX and a browser. >> Download your FREE copy of Splunk now >> >> http://get.splunk.com/ >> _______________________________________________ >> Simpleweb-Support mailing list >> Sim...@li... >> > https://lists.sourceforge.net/lists/listinfo/simpleweb-support >> > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > ---------------------------------------------------------------------- > --- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a > browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Kai S. <sch...@gm...> - 2007-11-03 02:05:37
|
sweetness Niall, I'm sure your version will end up much better than mine :) -k On 11/2/07, Niall Gallagher <gal...@ya...> wrote: > > Hi Jeff, > > This was implemented in a previous version, if you go > back to the 2.x versions you'll see how, its a simple > couple of methods, don't know why I removed it? Ill > make sure to add it back when I get a chance to > release 4.0. > > Niall > > > --- Jeff Nichols <je...@ne...> wrote: > > > Hi all, > > > > Is there any built-in way to handle form arrays? It > > seems that > > Simple's Parameters can only handle a single value > > for a specific name. > > > > The corresponding Servlet method would be > > ServletRequest.getParameterValues(String name): > > > > > http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ > > > > > ServletRequest.html#getParameterValues(java.lang.String) > > > > Thanks, > > Jeff > > > > > ------------------------------------------------------------------------- > > This SF.net email is sponsored by: Splunk Inc. > > Still grepping through log files to find problems? > > Stop. > > Now Search log events and configuration files using > > AJAX and a browser. > > Download your FREE copy of Splunk now >> > > http://get.splunk.com/ > > _______________________________________________ > > Simpleweb-Support mailing list > > Sim...@li... > > > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > |
From: Niall G. <gal...@ya...> - 2007-11-02 21:46:58
|
Hi Jeff, This was implemented in a previous version, if you go back to the 2.x versions you'll see how, its a simple couple of methods, don't know why I removed it? Ill make sure to add it back when I get a chance to release 4.0. Niall --- Jeff Nichols <je...@ne...> wrote: > Hi all, > > Is there any built-in way to handle form arrays? It > seems that > Simple's Parameters can only handle a single value > for a specific name. > > The corresponding Servlet method would be > ServletRequest.getParameterValues(String name): > > http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ > > ServletRequest.html#getParameterValues(java.lang.String) > > Thanks, > Jeff > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? > Stop. > Now Search log events and configuration files using > AJAX and a browser. > Download your FREE copy of Splunk now >> > http://get.splunk.com/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Andrew R. <ryz...@gm...> - 2007-11-02 14:32:35
|
Hi Niall, Thanks a lot, you are right! It`s works. :) -- Regards Andrew Ryzhokhin www.ardas.dp.ua |
From: Jeff N. <je...@ne...> - 2007-11-02 13:39:53
|
Hi all, Is there any built-in way to handle form arrays? It seems that Simple's Parameters can only handle a single value for a specific name. The corresponding Servlet method would be ServletRequest.getParameterValues(String name): http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/servlet/ ServletRequest.html#getParameterValues(java.lang.String) Thanks, Jeff |
From: Niall G. <gal...@ya...> - 2007-11-01 20:44:42
|
Hi, Ya, you can do this if you like, its pretty easy. The request is not completed until you close the conneciton. So you can do the following: public class MyService extends Service{ private MyMessenger messenger; public MyService(Context context) { super(context); messenger = new MyMessenger(); messenger.start(); } public void process(Request req, Response resp){ MyTrasaction t = new MyTrasaction(req, resp); messenger.process(t); } } public class MyMessenger extends Thread { private LinkedBlockingQueue<Transaction> queue; public MyMessenger() { queue = new LinkedBlockingQueue<MyTransaction>(); } public void process(MyTransaction t) { q.offer(t); } public void run() { while(true) { MyTransaciton t = queue.take(); someProcess(t); } } public void someProcess(MyTransaciton t) { // do what you want here } } public class MyTransaction { private Response resp; private Request req; public MyTransaction(Request req, Response resp) { this.req = req; this.resp = resp; } public Request getRequest(){ return req; } public Response getResponse() { return resp; } public void close() { resp.getOutputStream().close(); } } So the connection is not closed and completed until you close your transaction. You can do what you want from there. Whether its events or backend processing, the connection will stay alive until you decide. The container NEVER closes the connection, when its closed is up to you. Niall --- Andrew Ryzhokhin <ryz...@gm...> wrote: > Hi, > > Unfortunately I planed to have more concurrent > long-lived requests than 100 > and than 1000 and more. :( > My application is similarly of instant messenger. > And each user use one > long-lived request to the server. > > May be the Simple have a mode when it haven`t any > restriction of request > processing? > > What happen with server if I increase the number of > threads to one million? > > On 11/1/07, Niall Gallagher > <gal...@ya...> wrote: > > > > Hi, > > > > In this case you need to increase the number of > > threads in the thread pool. You need to do the > > following. > > > > ProcessQueue.getInstance().resize(100) > > > > This will increase the number of concurrent > requests > > to 100. > > > > Niall > > > > --- Andrew Ryzhokhin <ryz...@gm...> wrote: > > > > > Hi Niall, > > > > > > > > > Thank you for the answer. Yes, you are right if > it > > > relates to quick > > > processing HTTP requests. > > > The key point of my question is 'long-lived > > > HTTP connections'. You can use the following > code > > > to reproduce my problem: > > > > > > Implement test handler with long time > processing, > > > for example 10 secs. > > > > > > public class DelayHandler extends Service { > > > > > > public DelayHandler(Context context) > > > { > > > super(context); > > > } > > > > > > > > > protected void process(Request request, Response > > > response) throws Exception > > > { > > > > > > String param = > > > request.getParameter("counter"); > > > Log.debug(this, "Start for: " + param); > > > Thread.sleep(10000); > > > response.commit(); > > > Log.debug(this, "End for: " + param); > > > } > > > } > > > > > > I used JMeter for load testing. My test sends 40 > > > HTTP Requests to > > > resource processed with DelayHandler service in > the > > > same time. > > > > > > All my requests have parameter 'counter' with > number > > > of request. But > > > handler is processed only first 20 requests and > then > > > other 20 > > > requests. > > > > > > Seems this restriction is hardcoded in the > > > ProcessQueue.java at line 64. > > > > > > The log I received is attached below, please, to > > > draw attention to time > > > (seconds) and numbers of requests: > > > > ================================================== > > > > > > > -- > Regards > Andrew Ryzhokhin > www.ardas.dp.ua > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? > Stop. > Now Search log events and configuration files using > AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/> _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Andrew R. <ryz...@gm...> - 2007-11-01 19:20:18
|
Hi, Unfortunately I planed to have more concurrent long-lived requests than 100 and than 1000 and more. :( My application is similarly of instant messenger. And each user use one long-lived request to the server. May be the Simple have a mode when it haven`t any restriction of request processing? What happen with server if I increase the number of threads to one million? On 11/1/07, Niall Gallagher <gal...@ya...> wrote: > > Hi, > > In this case you need to increase the number of > threads in the thread pool. You need to do the > following. > > ProcessQueue.getInstance().resize(100) > > This will increase the number of concurrent requests > to 100. > > Niall > > --- Andrew Ryzhokhin <ryz...@gm...> wrote: > > > Hi Niall, > > > > > > Thank you for the answer. Yes, you are right if it > > relates to quick > > processing HTTP requests. > > The key point of my question is 'long-lived > > HTTP connections'. You can use the following code > > to reproduce my problem: > > > > Implement test handler with long time processing, > > for example 10 secs. > > > > public class DelayHandler extends Service { > > > > public DelayHandler(Context context) > > { > > super(context); > > } > > > > > > protected void process(Request request, Response > > response) throws Exception > > { > > > > String param = > > request.getParameter("counter"); > > Log.debug(this, "Start for: " + param); > > Thread.sleep(10000); > > response.commit(); > > Log.debug(this, "End for: " + param); > > } > > } > > > > I used JMeter for load testing. My test sends 40 > > HTTP Requests to > > resource processed with DelayHandler service in the > > same time. > > > > All my requests have parameter 'counter' with number > > of request. But > > handler is processed only first 20 requests and then > > other 20 > > requests. > > > > Seems this restriction is hardcoded in the > > ProcessQueue.java at line 64. > > > > The log I received is attached below, please, to > > draw attention to time > > (seconds) and numbers of requests: > > ================================================== > > > -- Regards Andrew Ryzhokhin www.ardas.dp.ua |
From: Niall G. <gal...@ya...> - 2007-11-01 18:55:14
|
Hi, In this case you need to increase the number of threads in the thread pool. You need to do the following. ProcessQueue.getInstance().resize(100) This will increase the number of concurrent requests to 100. Niall --- Andrew Ryzhokhin <ryz...@gm...> wrote: > Hi Niall, > > > Thank you for the answer. Yes, you are right if it > relates to quick > processing HTTP requests. > The key point of my question is 'long-lived > HTTP connections'. You can use the following code > to reproduce my problem: > > Implement test handler with long time processing, > for example 10 secs. > > public class DelayHandler extends Service { > > public DelayHandler(Context context) > { > super(context); > } > > > protected void process(Request request, Response > response) throws Exception > { > > String param = > request.getParameter("counter"); > Log.debug(this, "Start for: " + param); > Thread.sleep(10000); > response.commit(); > Log.debug(this, "End for: " + param); > } > } > > I used JMeter for load testing. My test sends 40 > HTTP Requests to > resource processed with DelayHandler service in the > same time. > > All my requests have parameter 'counter' with number > of request. But > handler is processed only first 20 requests and then > other 20 > requests. > > Seems this restriction is hardcoded in the > ProcessQueue.java at line 64. > > The log I received is attached below, please, to > draw attention to time > (seconds) and numbers of requests: > ================================================== > > 17:03:26,875 [DelayHandler] Start for: 2 > 17:03:26,890 [DelayHandler] Start for: 4 > 17:03:26,953 [DelayHandler] Start for: 5 > 17:03:26,968 [DelayHandler] Start for: 6 > 17:03:27,000 [DelayHandler] Start for: 7 > 17:03:27,062 [DelayHandler] Start for: 8 > 17:03:27,078 [DelayHandler] Start for: 9 > 17:03:27,078 [DelayHandler] Start for: 10 > 17:03:27,109 [DelayHandler] Start for: 11 > 17:03:27,171 [DelayHandler] Start for: 13 > 17:03:27,171 [DelayHandler] Start for: 12 > 17:03:27,187 [DelayHandler] Start for: 14 > 17:03:27,203 [DelayHandler] Start for: 15 > 17:03:27,265 [DelayHandler] Start for: 16 > 17:03:27,281 [DelayHandler] Start for: 17 > 17:03:27,281 [DelayHandler] Start for: 18 > 17:03:27,312 [DelayHandler] Start for: 19 > 17:03:27,375 [DelayHandler] Start for: 21 > 17:03:27,375 [DelayHandler] Start for: 20 > 17:03:27,390 [DelayHandler] Start for: 22 > > ================================================== > Strange pause approximately length of 10 seconds. > ================================================== > > 17:03:36,875 [DelayHandler] End for: 2 > 17:03:36,875 [DelayHandler] Start for: 23 > 17:03:36,890 [DelayHandler] End for: 4 > 17:03:36,890 [DelayHandler] Start for: 24 > 17:03:36,968 [DelayHandler] End for: 5 > 17:03:36,968 [DelayHandler] Start for: 25 > 17:03:36,984 [DelayHandler] End for: 6 > 17:03:36,984 [DelayHandler] Start for: 26 > 17:03:37,000 [DelayHandler] End for: 7 > 17:03:37,000 [DelayHandler] Start for: 27 > 17:03:37,062 [DelayHandler] End for: 8 > 17:03:37,062 [DelayHandler] Start for: 29 > 17:03:37,078 [DelayHandler] End for: 9 > 17:03:37,078 [DelayHandler] Start for: 28 > 17:03:37,078 [DelayHandler] End for: 10 > 17:03:37,078 [DelayHandler] Start for: 30 > 17:03:37,109 [DelayHandler] End for: 11 > 17:03:37,109 [DelayHandler] Start for: 31 > 17:03:37,171 [DelayHandler] End for: 13 > 17:03:37,171 [DelayHandler] Start for: 32 > 17:03:37,171 [DelayHandler] End for: 12 > 17:03:37,171 [DelayHandler] Start for: 33 > 17:03:37,187 [DelayHandler] End for: 14 > 17:03:37,187 [DelayHandler] Start for: 34 > 17:03:37,203 [DelayHandler] End for: 15 > 17:03:37,203 [DelayHandler] Start for: 35 > 17:03:37,265 [DelayHandler] End for: 16 > 17:03:37,265 [DelayHandler] Start for: 36 > 17:03:37,281 [DelayHandler] End for: 17 > 17:03:37,281 [DelayHandler] Start for: 37 > 17:03:37,281 [DelayHandler] End for: 18 > 17:03:37,281 [DelayHandler] Start for: 38 > 17:03:37,312 [DelayHandler] End for: 19 > 17:03:37,312 [DelayHandler] Start for: 39 > 17:03:37,375 [DelayHandler] End for: 21 > 17:03:37,375 [DelayHandler] Start for: 40 > 17:03:37,375 [DelayHandler] End for: 20 > 17:03:37,375 [DelayHandler] Start for: 1 > 17:03:37,390 [DelayHandler] End for: 22 > 17:03:37,390 [DelayHandler] Start for: 3 > 17:03:46,890 [DelayHandler] End for: 23 > 17:03:46,890 [DelayHandler] End for: 24 > 17:03:46,968 [DelayHandler] End for: 25 > 17:03:46,984 [DelayHandler] End for: 26 > 17:03:47,015 [DelayHandler] End for: 27 > 17:03:47,062 [DelayHandler] End for: 29 > 17:03:47,078 [DelayHandler] End for: 28 > 17:03:47,078 [DelayHandler] End for: 30 > 17:03:47,109 [DelayHandler] End for: 31 > 17:03:47,171 [DelayHandler] End for: 32 > 17:03:47,171 [DelayHandler] End for: 33 > 17:03:47,187 [DelayHandler] End for: 34 > 17:03:47,218 [DelayHandler] End for: 35 > 17:03:47,265 [DelayHandler] End for: 36 > 17:03:47,281 [DelayHandler] End for: 37 > 17:03:47,281 [DelayHandler] End for: 38 > 17:03:47,312 [DelayHandler] End for: 39 > 17:03:47,375 [DelayHandler] End for: 40 > 17:03:47,375 [DelayHandler] End for: 1 > 17:03:47,390 [DelayHandler] End for: 3 > > ================================================== > > Thus server process batches of 20 requests. > > On 10/31/07, Niall Gallagher > <gal...@ya...> wrote: > > Hi Andrew, > > > > I typically run load tests with in excess of 2000 > > connections all working concurrently. I am not > sure > > what your issue is. However simple will close > > connections that have not been active within a > certain > > number of seconds typically less than about 8 > seconds. > > > > If you want to change this you can modify the > Poller > > to keep connections alive for longer. > > > > Niall > > > > --- Andrew Ryzhokhin <ryz...@gm...> wrote: > > > > > Hi all. > > > > > > I have application based on Simple HTTP server. > > > My application used long-lived HTTP connections > > > between the client and > > > server (comet technology). > > > It seems Simple supports only 20 competitive > > > connections. Other > > > connections stored on the queue. So, my > long-lived > > > connections blocked > > > server. > > > > > > What should I do for keeping more user > connections? > > > Could anybody help me please? > > > Thanks a lot... > > -- > Regards > Andrew Ryzhokhin > www.ardas.dp.ua > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? > Stop. > Now Search log events and configuration files using > AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/> _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Andrew R. <ryz...@gm...> - 2007-11-01 15:44:41
|
Hi Niall, Thank you for the answer. Yes, you are right if it relates to quick processing HTTP requests. The key point of my question is 'long-lived HTTP connections'. You can use the following code to reproduce my problem: Implement test handler with long time processing, for example 10 secs. public class DelayHandler extends Service { public DelayHandler(Context context) { super(context); } protected void process(Request request, Response response) throws Exception { String param = request.getParameter("counter"); Log.debug(this, "Start for: " + param); Thread.sleep(10000); response.commit(); Log.debug(this, "End for: " + param); } } I used JMeter for load testing. My test sends 40 HTTP Requests to resource processed with DelayHandler service in the same time. All my requests have parameter 'counter' with number of request. But handler is processed only first 20 requests and then other 20 requests. Seems this restriction is hardcoded in the ProcessQueue.java at line 64. The log I received is attached below, please, to draw attention to time (seconds) and numbers of requests: ================================================== 17:03:26,875 [DelayHandler] Start for: 2 17:03:26,890 [DelayHandler] Start for: 4 17:03:26,953 [DelayHandler] Start for: 5 17:03:26,968 [DelayHandler] Start for: 6 17:03:27,000 [DelayHandler] Start for: 7 17:03:27,062 [DelayHandler] Start for: 8 17:03:27,078 [DelayHandler] Start for: 9 17:03:27,078 [DelayHandler] Start for: 10 17:03:27,109 [DelayHandler] Start for: 11 17:03:27,171 [DelayHandler] Start for: 13 17:03:27,171 [DelayHandler] Start for: 12 17:03:27,187 [DelayHandler] Start for: 14 17:03:27,203 [DelayHandler] Start for: 15 17:03:27,265 [DelayHandler] Start for: 16 17:03:27,281 [DelayHandler] Start for: 17 17:03:27,281 [DelayHandler] Start for: 18 17:03:27,312 [DelayHandler] Start for: 19 17:03:27,375 [DelayHandler] Start for: 21 17:03:27,375 [DelayHandler] Start for: 20 17:03:27,390 [DelayHandler] Start for: 22 ================================================== Strange pause approximately length of 10 seconds. ================================================== 17:03:36,875 [DelayHandler] End for: 2 17:03:36,875 [DelayHandler] Start for: 23 17:03:36,890 [DelayHandler] End for: 4 17:03:36,890 [DelayHandler] Start for: 24 17:03:36,968 [DelayHandler] End for: 5 17:03:36,968 [DelayHandler] Start for: 25 17:03:36,984 [DelayHandler] End for: 6 17:03:36,984 [DelayHandler] Start for: 26 17:03:37,000 [DelayHandler] End for: 7 17:03:37,000 [DelayHandler] Start for: 27 17:03:37,062 [DelayHandler] End for: 8 17:03:37,062 [DelayHandler] Start for: 29 17:03:37,078 [DelayHandler] End for: 9 17:03:37,078 [DelayHandler] Start for: 28 17:03:37,078 [DelayHandler] End for: 10 17:03:37,078 [DelayHandler] Start for: 30 17:03:37,109 [DelayHandler] End for: 11 17:03:37,109 [DelayHandler] Start for: 31 17:03:37,171 [DelayHandler] End for: 13 17:03:37,171 [DelayHandler] Start for: 32 17:03:37,171 [DelayHandler] End for: 12 17:03:37,171 [DelayHandler] Start for: 33 17:03:37,187 [DelayHandler] End for: 14 17:03:37,187 [DelayHandler] Start for: 34 17:03:37,203 [DelayHandler] End for: 15 17:03:37,203 [DelayHandler] Start for: 35 17:03:37,265 [DelayHandler] End for: 16 17:03:37,265 [DelayHandler] Start for: 36 17:03:37,281 [DelayHandler] End for: 17 17:03:37,281 [DelayHandler] Start for: 37 17:03:37,281 [DelayHandler] End for: 18 17:03:37,281 [DelayHandler] Start for: 38 17:03:37,312 [DelayHandler] End for: 19 17:03:37,312 [DelayHandler] Start for: 39 17:03:37,375 [DelayHandler] End for: 21 17:03:37,375 [DelayHandler] Start for: 40 17:03:37,375 [DelayHandler] End for: 20 17:03:37,375 [DelayHandler] Start for: 1 17:03:37,390 [DelayHandler] End for: 22 17:03:37,390 [DelayHandler] Start for: 3 17:03:46,890 [DelayHandler] End for: 23 17:03:46,890 [DelayHandler] End for: 24 17:03:46,968 [DelayHandler] End for: 25 17:03:46,984 [DelayHandler] End for: 26 17:03:47,015 [DelayHandler] End for: 27 17:03:47,062 [DelayHandler] End for: 29 17:03:47,078 [DelayHandler] End for: 28 17:03:47,078 [DelayHandler] End for: 30 17:03:47,109 [DelayHandler] End for: 31 17:03:47,171 [DelayHandler] End for: 32 17:03:47,171 [DelayHandler] End for: 33 17:03:47,187 [DelayHandler] End for: 34 17:03:47,218 [DelayHandler] End for: 35 17:03:47,265 [DelayHandler] End for: 36 17:03:47,281 [DelayHandler] End for: 37 17:03:47,281 [DelayHandler] End for: 38 17:03:47,312 [DelayHandler] End for: 39 17:03:47,375 [DelayHandler] End for: 40 17:03:47,375 [DelayHandler] End for: 1 17:03:47,390 [DelayHandler] End for: 3 ================================================== Thus server process batches of 20 requests. On 10/31/07, Niall Gallagher <gal...@ya...> wrote: > Hi Andrew, > > I typically run load tests with in excess of 2000 > connections all working concurrently. I am not sure > what your issue is. However simple will close > connections that have not been active within a certain > number of seconds typically less than about 8 seconds. > > If you want to change this you can modify the Poller > to keep connections alive for longer. > > Niall > > --- Andrew Ryzhokhin <ryz...@gm...> wrote: > > > Hi all. > > > > I have application based on Simple HTTP server. > > My application used long-lived HTTP connections > > between the client and > > server (comet technology). > > It seems Simple supports only 20 competitive > > connections. Other > > connections stored on the queue. So, my long-lived > > connections blocked > > server. > > > > What should I do for keeping more user connections? > > Could anybody help me please? > > Thanks a lot... -- Regards Andrew Ryzhokhin www.ardas.dp.ua |
From: Niall G. <gal...@ya...> - 2007-10-31 20:37:07
|
Hi Andrew, I typically run load tests with in excess of 2000 connections all working concurrently. I am not sure what your issue is. However simple will close connections that have not been active within a certain number of seconds typically less than about 8 seconds. If you want to change this you can modify the Poller to keep connections alive for longer. Niall --- Andrew Ryzhokhin <ryz...@gm...> wrote: > Hi all. > > I have application based on Simple HTTP server. > My application used long-lived HTTP connections > between the client and > server (comet technology). > It seems Simple supports only 20 competitive > connections. Other > connections stored on the queue. So, my long-lived > connections blocked > server. > > What should I do for keeping more user connections? > Could anybody help me please? > Thanks a lot... > > -- > Regards > Andrew Ryzhokhin > www.ardas.dp.ua > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? > Stop. > Now Search log events and configuration files using > AJAX and a browser. > Download your FREE copy of Splunk now >> > http://get.splunk.com/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |
From: Andrew R. <ryz...@gm...> - 2007-10-31 18:43:19
|
Hi all. I have application based on Simple HTTP server. My application used long-lived HTTP connections between the client and server (comet technology). It seems Simple supports only 20 competitive connections. Other connections stored on the queue. So, my long-lived connections blocked server. What should I do for keeping more user connections? Could anybody help me please? Thanks a lot... -- Regards Andrew Ryzhokhin www.ardas.dp.ua |
From: Jeff N. <je...@ne...> - 2007-10-12 09:08:12
|
Hi Niall, thanks for your response. On Oct 11, 2007, at 7:30 PM, Niall Gallagher wrote: > Seems now Safari does not support the max-age > suggestion in RFC 2109 either. I ended up writing my own utility for setting a cookie with an 'expires' parameter, but would of course prefer to use built-in methods if possible. > Cookie cookie = null; > > for(Cookie c : state.getCookies()) { > if(c.getName().equals(MY_COOKIE_NAME)) { > cookie = c; > break; > } > } For my case, this will fail in the same way as State.getCookie(String name). The problem is in PlainState.init(String[] list), where the Cookie headers are parsed and put into a Hashtable, with the last inserted value for a key winning. My workaround is to maintain my own map of cookies: Map<String,String> cookies = new HashMap<String,String>(); CookieParser parser = new CookieParser(request.getValue("Cookie")); while (parser.hasMore()) { Cookie cookie = parser.next(); String name = cookie.getName(); if (!cookies.containsKey(name)) { cookies.put(name, cookie.getValue()); } } > --- Jeff Nichols <je...@ne...> wrote: > >> Safari seems to handle sending its cookies >> differently than most >> other browsers. It sends *all* of its cookies for a >> domain, >> regardless of 'path', but in an order of decreasing >> relevance. >> >> For example, if the stored cookies are >> >> test=1; path=/ >> test=2; path=/dir >> test=3; path=/dir/file >> >> Safari will send a request to /dir/file with the >> header >> >> Cookie: test=3; test=2; test=1 >> >> I have no idea if this is legal or proper, but it >> causes issues with >> Simple's PlainState because getCookie(name) returns >> the last value in >> the Cookie header, which is actually the least >> relevant value in this >> case. >> >> I'm not sure if this is something that should be >> changed in Simple, >> but thought it could be helpful information. >> >> A workaround is to manually iterate over the Cookie >> header with >> CookieParser, returning the first value found. >> >> Jeff |
From: Niall G. <gal...@ya...> - 2007-10-11 17:30:42
|
Hi, Thanks for the feedback, Ill look in to it. One thing I did notice is that few browser support RFC 2109 properly, even Netscape having written the spec did not support max-age, and did not handle the path in quotes. Seems now Safari does not support the max-age suggestion in RFC 2109 either. Can't see the point in specifications if they are not followed, anyway for the problem you describe here you would have to do: Cookie cookie = null; for(Cookie c : state.getCookies()) { if(c.getName().equals(MY_COOKIE_NAME)) { cookie = c; break; } } Not very convinient, should really be able to acquire the array by name. Niall --- Jeff Nichols <je...@ne...> wrote: > Safari seems to handle sending its cookies > differently than most > other browsers. It sends *all* of its cookies for a > domain, > regardless of 'path', but in an order of decreasing > relevance. > > For example, if the stored cookies are > > test=1; path=/ > test=2; path=/dir > test=3; path=/dir/file > > Safari will send a request to /dir/file with the > header > > Cookie: test=3; test=2; test=1 > > I have no idea if this is legal or proper, but it > causes issues with > Simple's PlainState because getCookie(name) returns > the last value in > the Cookie header, which is actually the least > relevant value in this > case. > > I'm not sure if this is something that should be > changed in Simple, > but thought it could be helpful information. > > A workaround is to manually iterate over the Cookie > header with > CookieParser, returning the first value found. > > Jeff > > > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? > Stop. > Now Search log events and configuration files using > AJAX and a browser. > Download your FREE copy of Splunk now >> > http://get.splunk.com/ > _______________________________________________ > Simpleweb-Support mailing list > Sim...@li... > https://lists.sourceforge.net/lists/listinfo/simpleweb-support > ____________________________________________________________________________________ Don't let your dream ride pass you by. Make it a reality with Yahoo! Autos. http://autos.yahoo.com/index.html |
From: Jeff N. <je...@ne...> - 2007-10-11 13:47:05
|
On Oct 11, 2007, at 2:48 PM, Jeff Nichols wrote: > Hmm... I somehow missed Request.getState(). One more update, then I'm done with this thread... I promise. Safari doesn't support the max-age parameter for cookies. So if you want a cookie to last across browser sessions in Safari, you'll have to write your own Set-Cookie header. Jeff |
From: Jeff N. <je...@ne...> - 2007-10-11 13:03:17
|
Safari seems to handle sending its cookies differently than most other browsers. It sends *all* of its cookies for a domain, regardless of 'path', but in an order of decreasing relevance. For example, if the stored cookies are test=1; path=/ test=2; path=/dir test=3; path=/dir/file Safari will send a request to /dir/file with the header Cookie: test=3; test=2; test=1 I have no idea if this is legal or proper, but it causes issues with Simple's PlainState because getCookie(name) returns the last value in the Cookie header, which is actually the least relevant value in this case. I'm not sure if this is something that should be changed in Simple, but thought it could be helpful information. A workaround is to manually iterate over the Cookie header with CookieParser, returning the first value found. Jeff |
From: Jeff N. <je...@ne...> - 2007-10-11 12:48:29
|
On Oct 11, 2007, at 11:09 AM, Jeff Nichols wrote: > I've been scouring over the javadocs for a convenience method for > setting cookies in a Response, but have come up with nothing. I can > (I guess) of course set a cookie by manually adding a 'Set-Cookie' > header, but this seems like the perfect opportunity for a utility > method. Hmm... I somehow missed Request.getState(). However, in the mean time I've found another issue involving cookies for which I'll start a new thread. |
From: Jeff N. <je...@ne...> - 2007-10-11 09:09:53
|
I've been scouring over the javadocs for a convenience method for setting cookies in a Response, but have come up with nothing. I can (I guess) of course set a cookie by manually adding a 'Set-Cookie' header, but this seems like the perfect opportunity for a utility method. Thanks, Jeff |
From: shay t. <sha...@ho...> - 2007-08-19 12:48:22
|
I dont getit... look like that the xml files that i downloaded as a sample. not working take me 2 hours to ubderstant that this is the mapper format <mapper> <lookup> <service name="TestService" type="org.tenLevels.monitorLevelServer.httpServer.test.TestService"/> </lookup> <resolve> <match name="TestService" path="/*.vm"/> </resolve> </mapper> the TestService example is not working for me.. any simple and uptodate tutorial thanks. _________________________________________________________________ News, entertainment and everything you care about at Live.com. Get it now! http://www.live.com/getstarted.aspx |
From: Nit <ni...@gm...> - 2007-07-30 20:42:06
|
Hi, if you take a look at http://de.wikipedia.org/wiki/ISO_8859-1 there are exactly 5 characters that are "greened out" in Windows-1252 all with the high byte set. So I guess this might be the encoding problem as they get converted to "?". I don't know simple very well (in fact I used it once for a project 2 years ago and stayed on the mailing list for curiosity), but I had some encoding problems lately on Tomcat myself: 1. When converting the blob to a String you can set the encoding that should be used. Have you tried to explicitly set it to ISO-8859-1? String result = new String(blob.getBytes(0, blob.length()), "ISO-8859-1"); (after reading your mail again: Does the mysql driver implicitly convert the values to String? Then this suggestion might not be helping here ...) 2. Try running your JVM with the startup parameter -Dfile.encoding=ISO-8859-1 this should set the default encoding used for such conversions. This also should apply to the mysql driver. Best Regards Martin Kai Schutte wrote: > Hi, > > This bug probably originates from a JVM encoding property issue, and a > MySQL Java driver blob conversion issue. What I didn't mention in the > below mail is that I was running Simple on my desktop WinXP machine > and I always run Tomcat on my Linux (debian) box. I was using the same > MySQL server for each. BLOB values from Mysql are converted to > Strings, so character encoding matter. The default encoding for my > debian server is ISO-8859-1, while my desktop makes the JVM use > windows-1252. I haven't fully tested this yet, cause I'm still > struggling with JVM configurations, but I'm quite sure that's the > issue. Damn windows... > > Either way, I've run a test to transfer all bytes from -127 to 128 > with a protocol handler, and it worked fine. This bug is definitely > NOT Simple related. I originally was worried because the bytes that > were getting corrupted all had their high bit set, and numerical cast > conversion in Java can be a little weird, since there's no unsigned > numerical types in Java. After digging into it more, only 5 of the 127 > negative bytes were being converted into hexadecimal 3f, so it's > obvious that wasn't the problem. > > Thanks for your reply Niall, I'll post one more reply with the full > fix once I've tested it. > > I'm looking forward to 4.0 as well =D > > Regards, > > -Kai > |