Camelia, the Perl 6 bug

IRC log for #mojo, 2012-09-21

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:12 xaka sri: i'm doing a little research and so far i've found that instantiating Controller instance for every request has huge impact on performance, about 550% of degradation, but that's in case of 1_000_000 requests/s :)
00:14 kitt_vl joined #mojo
00:21 tempire_ joined #mojo
00:32 crab what's the alternative?
00:33 crab i mean, sure, we could stick a "return;" somewhere very early in request processing and surely it would be faster, but...
00:37 xaka crab: yeah, i understand, such design has much more pros than cons so i'm not arguing, just sharing some thoughts. having single instance for all requests would make development such a nightmare, it would be like threads without locks/mutex
00:58 laouji joined #mojo
01:00 tempire_ one instance to rule them all
01:13 xaka joined #mojo
01:17 crab xaka: agreed
01:23 crab but i wonder if we could do something like slab allocation to reduce the impact of having a separate controller per request
01:41 l3l1p joined #mojo
01:48 asarch joined #mojo
01:58 d4rkie joined #mojo
02:40 noganex_ joined #mojo
03:10 Foxcool joined #mojo
03:58 baton8 joined #mojo
04:07 baton8 joined #mojo
04:43 l3l1p joined #mojo
05:18 laouji joined #mojo
05:21 Britzel_ joined #mojo
05:32 rem_lex| joined #mojo
05:39 l3l1p joined #mojo
05:49 rem_lex|pivo joined #mojo
06:03 Foxcool joined #mojo
06:10 dpetrov_ joined #mojo
06:13 dross joined #mojo
06:18 azawawi joined #mojo
06:18 azawawi hi
06:19 rem_lex joined #mojo
06:19 Britzel_ moin
06:19 azawawi is there any Perl API for pushing JavaScript code into the client
06:20 azawawi i.e. backend + client is all Perl
06:42 rem_lex|pivo joined #mojo
06:58 fhelmber_ joined #mojo
07:02 rem_lex| joined #mojo
07:12 AmeliePoulain joined #mojo
07:14 AmeliePoulain joined #mojo
07:24 batman joined #mojo
07:38 Vandal joined #mojo
07:50 dross joined #mojo
07:54 rem_lex|pivo joined #mojo
07:55 * tempire wonders what will be the tipping point for migration away from twitter
08:33 dross tempire: for?
08:33 purl for fun.
08:41 marcus dross: api nazism
08:42 cosmincx joined #mojo
08:42 dross ohhhh, that drama
08:47 spleenjack joined #mojo
09:03 zpmorgan what library should I use for redis pub/sub in mojolicious?
09:03 cosmincx joined #mojo
09:08 Kwa zpmorgan: You've the forked MojoX::Redis that marcus and co are working on which supports pub/sub (https://github.com/marcusramberg/mojo-redis) but he's said that it's still being developed so things are subject to change.
09:09 marcus that's why it's not on cpan yet.
09:09 D4RK-PH0ENiX joined #mojo
09:10 zpmorgan the one on cpan has a pubsub test. does that one not work?
09:10 zpmorgan I'll try using yours anyways, marcus
09:10 marcus not sure, I've provided patches to make the basic functionality work, but I've not used the pubsub functionality.
09:11 marcus zpmorgan: I think we've done most of the heavy breakage.
09:11 marcus zpmorgan: batman and I are adding to it while using it in a new project.
09:12 Kwa marcus: Yah, I'll use ma words better next time. :)
09:19 Leandr joined #mojo
10:07 andrefs joined #mojo
10:13 Lucas1 joined #mojo
10:36 batman zpmorgan: i'm using the one me and marcus are working on without pubsub. works like a charm...
10:36 batman but we need to add a close event to provide reconnect (and more sophisticated stuff)
10:37 HtbaaPi_ joined #mojo
10:37 zpmorgan batman, nice to hear that. I'm still trying to figure it out
10:37 batman the hack i'm using now is simply to set a high timeout() and hoping the redis server will not close my connection
10:37 batman but a close event will hopefully be pushed to the mojo-redis repo later today
10:38 batman that way you can reconnect if the redis server decides to tear down the connection
10:38 batman i'm also thinking about adding auto-reconnect, but i haven't discussed that with marcus yet
10:39 batman another thing i want to add is a database_index() (or something) attribute which makes sure you're always connected to the right redis database (using SELECT $n)
10:39 batman i'm at work, so i need to do some drawing on the whiteboard now... *bbl*
10:39 batman looking forward to any feedback you got about Mojo::Redis
10:40 zpmorgan I'll let you know if there are any issues other than $self
10:41 batman $self?
10:41 purl $self is not the action
10:41 zpmorgan I'm not familiar with redis, and I'm not getting any results yet.
10:42 batman i really don't follow. do you have the dabatabase set up?
10:42 batman if you have cloned the mojo-redis repo, i suggest you look at the unittests
10:43 batman REDIS_SERVER=127.0.0.1:6379 prove -l -j4 # this should fail if the redis server is not running :)
10:43 batman anyway... *bbl*
10:43 zpmorgan thanks batman
10:47 zpmorgan batman, http://paste.scsys.co.uk/208173
10:48 zpmorgan it doesn't fail every time.
10:48 marcus zpmorgan: can you try it without -j4?
10:49 zpmorgan urf, okay. sorry
10:50 zpmorgan http://paste.scsys.co.uk/208174
10:53 batman ah! my bad...
10:53 batman looks like i'm getting some weird timeout issue in one of my custom servers after 15s.
10:54 batman does that mean that i have forgotten to set ->timeout(600) on one of my stream objects  ?
10:54 batman or could it be something else?
10:54 sri xaka: something is wrong with your benchmark if instantiating a controller is 550% performance degradation
10:56 sri sure, instantiating objects is not cheap in perl... but if it gets measurable for http requests you have to be doing something wrong
10:59 zpmorgan batman, one thing that isn't clear is the fact that redis connections can be garbage collected during a 'get' operation
11:00 batman zpmorgan: { my $redis = Mojo::Redis->new; $redis->get(..., sub { my($redis, $res) = @_ }); }
11:00 batman ^ like that?
11:00 batman you need to keep your redis object somewhere "global"
11:00 zpmorgan I see. I wasn't sure that was intended behavior
11:00 batman like if you're doing it in Mojolicious, you should store it in $self->app->{redis} = $redis; or something
11:01 batman that's "the perl way" i'm afraid :/
11:01 batman or $self->stash(redis => $redis); works as well. just be mindful about leaks :/
11:01 zpmorgan righto
11:05 sri xaka, crab: i've just tested a cache for controller instances, and there is no performance difference whatsoever
11:06 sri don't make up benchmarks!
11:10 Kwa left #mojo
11:10 Kwa joined #mojo
11:12 good_news_everyone joined #mojo
11:12 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/g0A6Yg
11:12 good_news_everyone [mojo/master] updated jQuery to version 1.8.2 - Sebastian Riedel
11:12 good_news_everyone left #mojo
11:12 dvinciguerra joined #mojo
11:57 zpmorgan batman, is there any real cost associated with creating new Redis connections?
11:57 batman i don't get the question
11:58 batman it's always a cost when creating a new connection. but i always do to make sure i'm properly connected
11:58 batman i would suppose that lim(cost) -> 0 compared to the rest you're doing (just guessing)
12:00 zpmorgan batman, I'm not sure what the question is either; I was just wondering if the cost was in milliseconds or microseconds
12:01 batman depends on your network i guess
12:01 batman but i also guess that it's more like milli than micro
12:01 zpmorgan redis tutorials & doc pages seem to suggest lots of parallel connections
12:01 batman yes. i suppose that makes sense. but it also depends on the latency of your network.
12:02 batman if your redis server is on the other side of earth, i would suggest parallel connections, but if it's in the same room then.... i wouldn't bother
12:02 batman anyway - i would not care about any of this UNTIL LATER
12:02 sri in micro benchmarks connections are very expensive
12:02 batman make your app work. then optimize. not the other way around
12:02 zpmorgan roger
12:03 batman sri: indeed. but i think what i'm saying is "about right" when it comes to the real world
12:04 sri hard to say... the real world is a scary place :)
12:04 batman :D
12:04 batman true that!
12:23 d4rkie joined #mojo
12:34 batman a stream has just timeout() right? and Mojo::UserAgent has connect_timeout, inactivity_timeout and timeout?
12:34 batman any other timeouts i've forgotten about?
12:39 ryozi joined #mojo
12:51 tempire joined #mojo
13:10 rem_lex|pivo joined #mojo
13:13 sri batman: inactivity_timeout *is* the stream timeout
13:13 sri the user agent uses all timeouts available
13:22 nic Is 'Mojo::' the new 'MojoX::' for things that aren't plugins?  Or is it just for core modules?
13:38 mire_ joined #mojo
13:48 bluescreen joined #mojo
13:55 nic marcus: In mojo-redis, do you mean to direct people to #ru.pm?
13:58 sri nic: not really
13:59 sri i don't quite understand why Mojo::Redis is in that namespace either
14:00 dross joined #mojo
14:00 nic We/someone should invent a new top-level to replace MojoX, but only for things that don't fit in Mojolicious::Plugin
14:00 zpmorgan MojoY?
14:00 Kwa :)
14:00 sri there are more namespaces for extensions
14:00 * nic new someone was going to say that :)
14:00 nic ^knew
14:00 sri Mojolicious::Plugin, Mojolicious::Command, Mojo::Reactor
14:01 nic Mojoluvin?
14:01 sri my mongodb client for example has a completely different name
14:01 zpmorgan MojoliXious
14:02 sri why is such a namespace necessary at all?
14:02 nic well, not saying 'necessary', just thought it would help people find the Mojo-luvin add-ons
14:03 sri that should be possible via a Mojolicious::Plugin::Foo, connecting the component to the framework
14:03 nic I suppose you can just search for packages that depend on Mojolicious
14:03 nic true
14:04 sri i don't really mind the MojoX namespace, in fact i've even removed the deprecation notice about it, my problem with it is the countless legacy modules that don't work anymore
14:05 * memowe has new glasses.
14:05 memowe now I can see you!
14:05 sri pretty much all of them are from the Mojolicious 0.x time :)
14:05 sri \o/
14:05 nic memowe: Does everything look rosy?
14:05 memowe um ...
14:05 memowe not really :D
14:06 memowe \o/
14:06 nic take them back, tell them you need pink ones
14:06 sri 😎
14:07 memowe eh eh
14:18 batman sri: ok. thanks (about timeout)
14:20 knshaum joined #mojo
14:25 tempire_ joined #mojo
14:26 Britzel joined #mojo
14:38 Jason__ joined #mojo
14:39 andrefs joined #mojo
14:58 knshaum joined #mojo
15:27 fhelmber_ joined #mojo
15:40 Foxcool joined #mojo
15:51 cosmincx joined #mojo
15:52 mire_ joined #mojo
15:53 xxtjaxx_ joined #mojo
15:53 xaka joined #mojo
16:07 d4rkie joined #mojo
16:14 abra joined #mojo
16:26 jzawodn joined #mojo
16:34 inokenty left #mojo
16:34 inokenty joined #mojo
17:13 andrefs joined #mojo
18:08 rem_lex| joined #mojo
18:17 yko joined #mojo
18:17 bzero joined #mojo
18:44 vishwanathms joined #mojo
18:48 vishwanathms_ joined #mojo
18:55 vishwanathms joined #mojo
19:36 * MojoX deprecates himself
20:05 xaka joined #mojo
22:09 good_news_everyone joined #mojo
22:09 good_news_everyone [mojo] kraih pushed 1 new commit to master: http://git.io/dGfPlA
22:09 good_news_everyone [mojo/master] fixed a few cookbook examples - Sebastian Riedel
22:09 good_news_everyone left #mojo
22:18 xaka i wish everyone could see the draft document that sri and other event loop developers are working on to suggest smart (and stupid) ideas or to learn \o/
22:19 sri i've brought that topic up recently, but things are moving very very slowly
22:20 xaka because people don't have time or motivation?
22:20 sri time
22:21 sri i'm also not sure suggestions from people that havn't implemented their own event loop yet would be that helpful
22:21 sri primary goal is a shared foundation for established event loops
22:25 sri the whole thing is pretty much useless for normal event loop users
22:25 sri (aside from being able to use multiple event loops concurrently)
22:30 davido joined #mojo
23:43 Adura joined #mojo

| Channels | #mojo index | Today | | Search | Google Search | Plain-Text | summary