From quasilists at gmail.com Sat Jun 10 11:50:31 2006 From: quasilists at gmail.com (quasi) Date: Sat, 10 Jun 2006 17:20:31 +0530 Subject: [tbnl-devel] load balancing and TBNL Message-ID: <8764j9grg8.fsf@agni4.cltp.com> Hey folks, I know this is not strictly TBNL related. But I guess you folks could have a suggestion. I have Apache2+mod_lisp2+TBNL running on CMUCL. There are several differnt types of page generating functions. Some very heavy computationally, some light. I am able to get ~200req/sec for the lighter ones with concurrency of 10. The heavy ones do about ~10req/sec. (ab2 benchmark) I want to be able to run different lisp images, now, for load balancing. I had asked on this list earlier and got the solution. I now have different url's mapped to different lisps using the setting in the apache config. But this has several limaitations. What if I want to have requests for one location go to multiple lisps in some load balancing fashion (e.g. round robin) ? What I wanted to know was, is it possible to have the same url mapped to different TBNL's listening on different ports so that requests are load balanced ? I want to be able to run, say, 5 lisp's all handling requests to mydomain.com/xyz, say. One way I thought this might be done was have different location in the apache config like xyz1, xyz2 etc.etc. each mapped to one lisp and then somehow map xyz to xyz1, xyz2 etc. I dont know how, if, this can be done. I dont even know if this is a good solution. thanks, -- quasi Utopia Unlimited! From tobia.conforto at linux.it Mon Jun 12 15:45:22 2006 From: tobia.conforto at linux.it (Toby) Date: Mon, 12 Jun 2006 17:45:22 +0200 Subject: [tbnl-devel] load balancing and TBNL In-Reply-To: <8764j9grg8.fsf@agni4.cltp.com> References: <8764j9grg8.fsf@agni4.cltp.com> Message-ID: <20060612154049.GB6279@localhost.localdomain> quasi wrote: > I want to have requests for one location go to multiple lisps > in some load balancing fashion I'd use some generic Apache load balancing solution, such as http://www.backhand.org/ Toby -- Signed/encrypted mail welcome. GPG/PGP Key-Id: 0x15C5C2EA From austin at pettomato.com Wed Jun 14 02:01:01 2006 From: austin at pettomato.com (Austin Haas) Date: Tue, 13 Jun 2006 22:01:01 -0400 Subject: [tbnl-devel] faking *request* for testing Message-ID: <448F6DDD.6010909@pettomato.com> Does anyone know of a way to fake a *request* to test a handler? The browser is crashing on a particular response, so it would be nice to be able to see the response in Slime. Thanks. -austin From phillip.m.jordan at gmail.com Wed Jun 14 07:18:38 2006 From: phillip.m.jordan at gmail.com (Phillip Jordan) Date: Wed, 14 Jun 2006 08:18:38 +0100 Subject: [tbnl-devel] faking *request* for testing In-Reply-To: <448F6DDD.6010909@pettomato.com> References: <448F6DDD.6010909@pettomato.com> Message-ID: <448FB84E.8070109@gmail.com> Austin Haas wrote: > Does anyone know of a way to fake a *request* to test a handler? > > The browser is crashing on a particular response, so it would be nice to be able > to see the response in Slime. If you set the global variable tbnl:*debug-mode* to t or any non-nil value, tbnl will keep the last request made to the server in the global variable tbnl:*request* where you can manually inspect it or call the dispatcher/handlers manually. This requires the browser to make the request, but by the sounds of it it's crashing on receiving the response. ~phil From tobia.conforto at linux.it Wed Jun 14 14:15:05 2006 From: tobia.conforto at linux.it (Toby) Date: Wed, 14 Jun 2006 16:15:05 +0200 Subject: [tbnl-devel] faking *request* for testing In-Reply-To: <448F6DDD.6010909@pettomato.com> References: <448F6DDD.6010909@pettomato.com> Message-ID: <20060614141503.GF6279@localhost.localdomain> Austin Haas wrote: > Does anyone know of a way to fake a *request* to test a handler? I find wget useful in these cases: wget -qO- http://your.url/here Useful options: -qO- displays the output in the console, -S shows the response headers instead (you cannot use it with -q) If you need to fake a POST, use: --post-data='field=value&field2=val2' Toby -- Pascal is for building pyramids?imposing, breathtaking structures built by armies pushing heavy blocks into place. Lisp is for building organisms. ?Alan Perlis From dbeauchesne at gmail.com Mon Jun 26 05:30:18 2006 From: dbeauchesne at gmail.com (Dan Beauchesne) Date: 26 Jun 2006 14:30:18 +0900 Subject: [tbnl-devel] Strange encoding problems with SBCL and TBNL Message-ID: <87hd285vrp.fsf@localhost.localdomain> Hi list, I'm running SBCL 0.9.13.52 (same error with 0.9.13 release) and TBNL 0.9.10. I've got a simple page set up that I need to simply print the return value of an external function. That function returns a list containing UTF-8 characters. I've set *show-lisp-errors-p* to T, here is the error: encoding error on stream # (:EXTERNAL-FORMAT :ASCII): the character with code 20170 cannot be encoded. I had done some digging on google and found someone in a similar situation with TBNL, and he tried changing his locale LC_ALL to a utf-8 one. The above (:EXTERNAL-FORMAT :ASCII part was :ASCII only after I set my locale to UTF-8, beforehand it was :LATIN-1, which I do not understand. Here is the code, if it helps: (in-package :tbnl-foo) (setq *dispatch-table* (list (create-prefix-dispatcher "/tbnl/foo" 'foo) 'default-dispatcher)) (defun foo () (let ((foo (jalat::search-hash "hello"))) (with-html-output (*standard-output*) (:h2 (str foo))))) (setq *dispatch-table* (nconc (mapcar (lambda (args) (apply #'create-prefix-dispatcher args)) '(("/tbnl/test/" foo))) (list #'default-dispatcher))) The external function simply returns a list of plists containing UTF-8 characters. I also tried setting *tbnl-default-external-format* to no avail. Thanks guys, -- Dan Beauchesne dbeauchesne -at- gmail -dot- com From edi at agharta.de Mon Jun 26 08:02:02 2006 From: edi at agharta.de (Edi Weitz) Date: Mon, 26 Jun 2006 10:02:02 +0200 Subject: [tbnl-devel] Strange encoding problems with SBCL and TBNL In-Reply-To: <87hd285vrp.fsf@localhost.localdomain> (Dan Beauchesne's message of "26 Jun 2006 14:30:18 +0900") References: <87hd285vrp.fsf@localhost.localdomain> Message-ID: On 26 Jun 2006 14:30:18 +0900, Dan Beauchesne wrote: > I'm running SBCL 0.9.13.52 (same error with 0.9.13 release) and TBNL > 0.9.10. > > I've got a simple page set up that I need to simply print the return > value of an external function. That function returns a list > containing UTF-8 characters. I've set *show-lisp-errors-p* to T, > here is the error: > > encoding error on stream # > (:EXTERNAL-FORMAT :ASCII): > the character with code 20170 cannot be encoded. > > I had done some digging on google and found someone in a similar > situation with TBNL, and he tried changing his locale LC_ALL to a > utf-8 one. The above (:EXTERNAL-FORMAT :ASCII part was :ASCII only > after I set my locale to UTF-8, beforehand it was :LATIN-1, which I > do not understand. Maybe you used a locale which wasn't recognized and therefore the system defaulted to ASCII? > Here is the code, if it helps: > > (in-package :tbnl-foo) > > (setq *dispatch-table* > (list (create-prefix-dispatcher "/tbnl/foo" 'foo) > 'default-dispatcher)) > > (defun foo () > (let ((foo (jalat::search-hash "hello"))) > (with-html-output (*standard-output*) > (:h2 (str foo))))) Note that even if everything else works the "Content-Length" header will probably be wrong. > (setq *dispatch-table* > (nconc > (mapcar (lambda (args) > (apply #'create-prefix-dispatcher args)) > '(("/tbnl/test/" foo))) > (list #'default-dispatcher))) > > The external function simply returns a list of plists containing > UTF-8 characters. I also tried setting > *tbnl-default-external-format* to no avail. The main problem seems to be to find out how one has to set up the stream to be able to send arbitrary Unicode characters. This is not really related to TBNL. If you don't get help here, I'd propose to ask on the SBCL mailing list. Cheers, Edi. From dbeauchesne at gmail.com Fri Jun 30 23:50:01 2006 From: dbeauchesne at gmail.com (Dan Beauchesne) Date: 01 Jul 2006 08:50:01 +0900 Subject: [tbnl-devel] Strange encoding problems with SBCL and TBNL In-Reply-To: References: <87hd285vrp.fsf@localhost.localdomain> Message-ID: <87lkre4312.fsf@localhost.localdomain> Hi! Thanks for the reply, > > I had done some digging on google and found someone in a similar > > situation with TBNL, and he tried changing his locale LC_ALL to a > > utf-8 one. The above (:EXTERNAL-FORMAT :ASCII part was :ASCII only > > after I set my locale to UTF-8, beforehand it was :LATIN-1, which I > > do not understand. > > Maybe you used a locale which wasn't recognized and therefore the > system defaulted to ASCII? Yes, it did just turn out to be bad configuration on my end. Sorry about that. I've been having a lot of fun mucking around with TBNL, but I've run into a bit of a wall here: in regards to my tiny page in my previous post, I've got a list of plists which I would like to use to generate a page of clickable links (one link for each plist) which, when clicked, would evaluate a lisp expression (actually, I just want to push that plist entry onto another list). I thought about using create-prefix-dispatcher and somehow keeping a separate *dispatch-table* for each session, but I thought there may be an easier way without having to modify the base code. Could you give me any advice on some solution? Thank you, -- Dan Beauchesne dbeauchesne -at- gmail -dot- com