The web in a box - a next generation web framework for the Perl programming language

IRC log for #mojo, 2014-02-17

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

All times shown according to UTC.

Time Nick Message
00:09 zM joined #mojo
00:13 GabrielVieira joined #mojo
00:20 jack joined #mojo
00:31 btyler joined #mojo
01:00 gnephiak joined #mojo
01:01 GabrielV_ joined #mojo
01:08 d4rkie joined #mojo
01:25 ka2u joined #mojo
02:10 klapperl joined #mojo
02:45 zM joined #mojo
03:14 zM joined #mojo
03:34 jberger_ bpmedley: thoughts? https://github.com/jberger/FrameworkBenchmarks/blob/master/mojolicious/setup.py
03:34 jberger_ I ditched all this regexing on the app to change the configuration
03:34 jberger_ better to write a configuration file on the fly :D
03:45 sivoais joined #mojo
03:45 jberger_ anyway last thing to clean up is the benchmark file
03:48 zM joined #mojo
04:14 damaya jberger_, how does Mojolicious compare to other frameworks?
04:14 damaya benchmark wise
04:17 damaya Hm, actually, I have a server with 256GB of RAM with dual xeon E5-2687W processors that I've been looking for something to do with.
04:17 damaya I think I will run all the bnchmarks and see for myself.
04:18 damaya not my server personally, but a server at my work that is not being used
04:18 zM joined #mojo
04:22 crab mojo is specially optimised for meaningless hello world benchmarks
04:33 mire_ joined #mojo
04:38 Stefan joined #mojo
04:54 stl joined #mojo
05:08 ka2u joined #mojo
05:10 hotsnow joined #mojo
05:13 hotsnow I write an application in this way:   sub startup { my $self = shift; my $var = 123; $r->get('/')->to('example#welcome'); }. i want to use the var as a global variable, how can i use the var in application example ?
05:21 dabudabu 256 GB of RAM :]~
05:27 ka2u joined #mojo
05:28 bpmedley jberger_: Very cool
05:30 bpmedley damaya: We're hoping to improve our techempower benchmark rank.  How many cores is the server?
05:36 bpmedley hotsnow: Maybe a helper with a state variable?
05:50 hotsnow I will try it, thanks
05:51 denis_boyun joined #mojo
06:10 Vandal joined #mojo
06:11 bjoernfan joined #mojo
06:14 bpmedley jberger_: http://pastie.org/8741084 <-- benchmark_config
06:15 zM joined #mojo
06:22 russum joined #mojo
06:30 zM joined #mojo
06:39 zM joined #mojo
06:55 damaya Each proc is a hexacore processor.
06:57 damaya I also have access to SPARC T5 servers with 128 cores and 2TB RAM
06:57 damaya but that's obviously some serious overkill and would probably not be very helpful
06:57 bpmedley damaya: Awesome!
06:57 damaya shit, my power is going out
06:58 damaya flickering anyway
06:58 bpmedley Are you familiar with the non-blocking coding model?
06:58 damaya yeah, bpmedley, if you want me to benchmark on any of these systems I can do it no problem.
06:59 damaya non-blocking as in no wait?
06:59 bpmedley Yes, using IO::Poll and friends.
07:00 damaya I know of it, but not much honestly.
07:02 bpmedley https://raw2.github.com/jberger/FrameworkBenchmarks/master/mojolicious/app.pl  <-- Want to benchmark this?
07:02 damaya bpmedley, in order to run on the SPARC system, the test would have the be modified to run on a Solaris 11 server.
07:03 bpmedley http://www.mongodb.org/downloads  <-- Will that compile on SPARC?
07:03 bpmedley Can you install JSON::XS?
07:03 bpmedley Or, would you prefer a Pure Perl solution?
07:05 sue joined #mojo
07:05 damaya One second. There are a few issues that I may have to spend some time figuring out.
07:05 damaya I am not at work at the moment, just connected to the VPN.
07:05 damaya I will be tomorrow evening if you're going to be around.
07:06 damaya And I already have JSON::XS on the server with 256GB RAM
07:06 damaya And on the SPARC T5 I can also install it
07:06 bpmedley Possibly, we'll figure something out.  jberger may have interest, as well.
07:06 bpmedley Are you familiar with "wrk?
07:06 damaya Ah, awesome. OK, so Mongo can be compiled in Solaris.
07:07 damaya wrk? Nope.
07:07 bpmedley ./wrk -t 10 -c 10 -d 30s 'http://127.0.0.1:8080/json'   <-- benchmark tool
07:07 bpmedley https://github.com/wg/wrk
07:09 damaya This sounds interesting. I am actually interested in how the SPARC T5 will perform here, since it's kind of made with Oracle databases in mind. Then again, I can't imagine it will be too bad considering the specs.
07:09 bpmedley Are you familiar with Apache's prefork model?
07:09 bpmedley That SPARC sounds amazing.
07:10 damaya It may take me a few days to get my hands on one of the systems though. I have to request a system from a different group of engineers.
07:10 damaya bpmedley, yeah, I am familiar with Apache prefork.
07:11 bpmedley Ok, so, you know how prefork has to spawn a new process for even a simple "Hello World" perl app?
07:11 damaya Yeah, I know that.
07:13 bpmedley So, with a non-blocking event loop a single-threaded process can handle dozens or hundreds of concurrent requests.
07:14 damaya OK, so what you're saying is that non-blocking event loops are pretty much the opposite of Apache's prefork model?
07:14 sue hi guys
07:15 bpmedley That's my understanding.  You can save hordes of ram that way.
07:15 damaya Yeah, so you don't have a ton of processes going, right?
07:15 bpmedley I can do 20913 JSON requests in 30 seconds with a single process.
07:15 damaya Holy shit.
07:15 purl Dominus vobiscum, et cum spiritu tuo *plop*
07:15 sue i'm curious as to why mojo is  called the 'real time' web framework
07:16 damaya OK, well I am excited to get in to work tomorrow evening and if I can get my hand on a system actually give this a try.
07:16 bpmedley sue: WebSockets, EventSource, Comet, other stuff I'm forgetting.. :)
07:16 sue 'real time' has a specific meaning to me that doesn't fit with 'web framework'
07:17 damaya sue, read about WebSockets and SSE vs Long Polling for a sense of the difference.
07:18 bpmedley sue: Are you referring to a real-time embedded system?
07:18 bpmedley Lke VxWorks?
07:18 sue note that a lot of embedded systems aren't real time
07:19 bpmedley Sure, are you coming from a C background?
07:20 bpmedley Or, Ada?   :)
07:20 sue i'm really really good with Perl actually
07:20 sue well, as good as i can stand to be
07:21 bpmedley Just curious.  I believe the real-time aspect mentioned on the Mojolicious website is in reference to the interactive capabilities of today's web.
07:23 sue a marketing idea
07:23 bpmedley What do you mean?
07:23 sue not really a feature of the framework itself
07:23 bpmedley The framework has to support things like WebSockets.
07:25 punter joined #mojo
07:26 crab and mojo's support for websockets and things like that goes pretty far beyond a marketing idea
07:26 crab whether "real-time" is the best term to describe it or not is a separate question
07:27 crab but it's certainly not the case that it's being used as fluff
07:28 Adurah_ I use RT kernels just for it!
07:33 D4RK-PH0ENiX joined #mojo
07:34 sue crab: for some reason you think marketing is fluff.  that's a popular notion (and not utterly without foundation) however i did not call it fluff.
07:35 crab you said "not really a feature of the framework itself".
07:35 crab but it is.
07:35 sue it's a feature of the modern web
07:35 maxhq joined #mojo
07:36 sue i think 'real time' is a somewhat unusual phrase for it
07:36 crab ok.
07:36 sue a web framework might well have support for such things
07:37 sue i didn't come here to taunt you, by the way
07:37 damaya sue, for someone like me I think real-time was a great way to put it. It got me looking at exactly what this real-time meant, and I've been using Mojolicious for websockets since. No more long polling in my apps, it's beautiful.
07:39 damaya And personally, considering the way things used to be, I'd say real-time is a good way to put it. How would you put it?
07:46 abra joined #mojo
07:55 sue heh. http://en.wikipedia.org/wiki/Real-time_web
07:55 sue well blow me down a gopher hole
07:59 eseyman joined #mojo
08:00 ver joined #mojo
08:05 crab ok.
08:16 dpetrov_ joined #mojo
08:17 * sue forces self to stop procrastinting and install mojo on server
08:19 bpmedley sue: You will love it.  It feels modern.
08:19 eugen_ joined #mojo
08:23 trone joined #mojo
08:24 schetchik joined #mojo
08:24 schetchik left #mojo
08:25 Andy2 joined #mojo
08:26 Dandre Hello,
08:26 Dandre I have a model class and I instanciate those objects from my controller. How can I read stash values from these objects? Must I pass a reference to the controller or is there nay alternative?
08:27 Dandre for instance access to caller environment
08:29 d4rkie joined #mojo
08:30 moritz Dandre: a model should never read stash values
08:30 moritz Dandre: that's the controller's job
08:32 Dandre ok but I have two issues:
08:32 Dandre first how can I get from model the user language to adapt my model's localization settings?
08:32 Dandre second: I need to controle model's acl from controller's authentication
08:35 moritz how to get the user language? Well, if it's stored in the DB, provide a method on the model that retrieves that
08:38 skullbocks joined #mojo
08:38 Dandre no it's gotten from the web browser settings
08:38 odc joined #mojo
08:39 moritz then it must be done in the controller, not in the model
08:41 basiliscos joined #mojo
08:41 Dandre yes but the strings are is the model
08:42 moritz then you probably want to pass the language to the model constructor, or something
08:42 moritz so the controller calls  Your::Model->new(lang => $lang_from_accept_language_header);
08:42 moritz or something along these lines
08:43 Dandre ok,
08:43 Dandre same answer i guess from user acl control
08:49 bpmedley Dandre: Don't listen.  Given in to accessing the controller form the model..  ;)
08:50 Dandre sorry I don't understand
08:50 bpmedley I was joking, sorry.  As in, give in to the dark side..
08:52 Dandre ok
08:52 bpmedley I was making light of the situation that usually arises in MVC - how much and where to share the data.
08:54 bowtie_ joined #mojo
08:56 Dandre I think I'll write a thin wrapper layer to use my Models from my Controllers
09:04 rawler joined #mojo
09:24 jwang joined #mojo
09:35 kwa joined #mojo
09:38 Stefan joined #mojo
09:46 punter joined #mojo
09:46 denis_boyun joined #mojo
09:48 ascent joined #mojo
09:51 abra joined #mojo
09:55 Jonneh joined #mojo
10:02 Kundun joined #mojo
10:07 ascent joined #mojo
10:12 stl joined #mojo
10:22 Andy2 Hey guys, i start a db connection in my main script (+helper) but want to use that connection in an other perl modul, what is the best way to do that?
10:23 Andy2 How can i pass a helper to a custom modul?
10:24 Andy2 Or: "What is teh best way to shar a db connection between modules/helpers/routes"?
10:39 crab $dbh = app->helper; Other::Module->something($dbh, ...other args...);
10:43 bpmedley Andy2: You might be able to use a singleton for your DB module, if you aren't using straight DBI
10:44 Andy2 i am using Mango and passed the object to my custom modul but i'm not sure that a good way to do it
10:49 crab why?
11:08 Dandre joined #mojo
11:24 denis_boyun joined #mojo
11:41 fhelmber_ joined #mojo
11:42 bpmedley Andy2: Something like this is what I was talking about: http://pastie.org/8741801
11:55 Andy2 bpmedley: I see, thanks a lot
12:17 Stefan joined #mojo
12:24 dod joined #mojo
12:28 cpan_mojo Mojolicious-Plugin-YamlConfig 0.1.7 by Danijel Tasov - http://metacpan.org/release/DATA/Mojolicious-Plugin-YamlConfig-0.1.7
13:03 d4rkie joined #mojo
13:10 nic joined #mojo
13:13 Jonneh joined #mojo
13:21 d4rkie joined #mojo
13:41 arthas joined #mojo
14:01 Jonneh_ joined #mojo
14:22 s1037989 joined #mojo
14:31 Jonneh joined #mojo
14:33 hummeleBop joined #mojo
14:35 mire_ joined #mojo
14:39 sh4 joined #mojo
14:40 Stefan joined #mojo
14:44 mire joined #mojo
14:52 cpan_mojo Mojolicious-Plugin-LinkEmbedder 0.03 by Jan Henning Thorsen - http://metacpan.org/release/JHTHORSEN/Mojolicious-Plugin-LinkEmbedder-0.03
14:56 Jonneh joined #mojo
14:57 Jonneh joined #mojo
14:58 d4rkie joined #mojo
15:02 dvinciguerra joined #mojo
15:03 btyler joined #mojo
15:12 asarch joined #mojo
15:14 jberger bpmedley / all: https://github.com/TechEmpower/FrameworkBenchmarks/pull/797
15:16 bpmedley jberger: Sweet.. I hope they include it in Round 9.
15:16 jberger good point, I should message the list
15:18 marty joined #mojo
15:19 sue joined #mojo
15:19 jberger https://groups.google.com/d/msg/framework-benchmarks/-D6mXi9N5qw/oO745MwkpQkJ
15:29 cfedde joined #mojo
15:29 meshl joined #mojo
15:35 rem_lex|pivo joined #mojo
15:39 bpmedley jberger: Thanks for the collaboration on that.. :)
15:41 jberger bpmedley: it was good fun
15:41 jberger I'm glad you got the ball rolling
15:41 jberger do you follow the finished product?
15:41 bpmedley Yes, everything makes sense.
15:42 jberger cool
16:03 Stefan joined #mojo
16:05 schetchik joined #mojo
16:11 jberger anyone know who qwasp is?
16:12 bpmedley Has a bit of an attitude.
16:14 jberger for someone who joined github 2 days ago
16:15 cpan_mojo MojoX-Renderer-IncludeLater 0.01 by CHGOVUK - http://metacpan.org/release/CHGOVUK/MojoX-Renderer-IncludeLater-0.01
16:15 bpmedley Maybe they just need to be more tactful; who knows.  I shouldn't jump to conclusions.
16:19 basiliscos joined #mojo
16:22 bpmedley jberger: Did you see that damaya has SPARC T5 they can test with?
16:23 jberger sounds like a fun test, does it help us at all?
16:24 bpmedley I'm not sure; other than being able to know what 128 cores can do.. :)
16:32 jberger oh, I agree, it sounds like a very fun test to do
16:48 hesco joined #mojo
17:12 ascent joined #mojo
17:15 sue joined #mojo
17:21 beyondcreed joined #mojo
18:06 jberger bpmedley: does this seem well measured? https://github.com/TechEmpower/FrameworkBenchmarks/pull/797#issuecomment-35308482
18:07 jberger note that qwasp's only other public history is to issue this comment https://github.com/tudorconstantin/FrameworkBenchmarks/commit/1d7d45596e7f42e17774b2beb268eb3c303aec7d#commitcomment-5388097
18:08 jberger and that about an hour after my first gist which contained this same content
18:55 bpmedley Hrmm, a most interesting conversation.. :)
18:56 batman joined #mojo
18:56 elvis joined #mojo
19:00 trone joined #mojo
19:29 elvis joined #mojo
19:29 batman joined #mojo
19:35 beyondcreed joined #mojo
19:37 denis_boyun joined #mojo
19:39 meshl joined #mojo
19:40 bpmedley jberger: Sorry, to respond to your "well measured" question; yes, you're fine.  We did a lot of work to make a "production app" and qwasp ended up saying they wanted to cheat on the benchmarks.
19:40 mire joined #mojo
20:01 LordVorp joined #mojo
20:02 elvis joined #mojo
20:03 batman joined #mojo
20:22 skullbocks joined #mojo
20:43 bpmedley_ joined #mojo
21:01 meshl joined #mojo
21:16 czinczar joined #mojo
21:18 czinczar anyone here run say 20 sites on 1 box? each site completely different?
21:18 czinczar without virtualization
21:18 czinczar just using name based vhosts or SIGH different ports? or FEAR multiple ip on 1 box
21:18 czinczar ?
21:21 btyler czinczar: docker might be a thing to look into. feels like virtualization, uses linux containers so the overhead is pretty minimal compared to full virt
21:21 btyler gives you fairly strong process/net stack isolation
21:25 czinczar oh I wana skip any virtualization
21:25 czinczar and just use name based vhosts
21:25 czinczar although dockers is new to me I will take a look
21:26 czinczar I want to skip all that pain and run the show on fewer big boxes.
21:26 czinczar with sas raid 10 instead of san
21:26 czinczar go anti x100
21:27 czinczar mojo of course support name based vhosts right?
21:27 czinczar supports///
21:27 czinczar or have I got to start a hypnotoad PER website?
21:27 czinczar or some such
21:27 czinczar which I could partition by using a different user for each....
21:28 czinczar to aid in debuging
21:29 czinczar I have a box 192g ram 48 cpu 2T disk
21:31 czinczar no one?
21:31 czinczar hmmm
21:31 czinczar everyone must be pounding out code
21:42 sjn joined #mojo
21:45 bobkare czinczar: hypnotoad isn't meant to run different unrelated sites, so you should add a layer outside of it. Personally I use varnish, others use nginx or apache. Pretty much any somewhat configureable http proxy will do
22:04 marty joined #mojo
22:05 czinczar so then you use differnt ports?
22:05 czinczar like 8001 8002 etc for each site?
22:05 czinczar behind the proxy?
22:06 czinczar interesting
22:07 bpmedley czinczar:  I use nginx
22:07 czinczar I have heard good things about the varnish
22:08 czinczar sometimes I play with cherokee
22:08 mire joined #mojo
22:09 mire joined #mojo
22:10 bpmedley I guess the main thing to realize is that a lot of people use reverse proxies for deployment.
22:11 czinczar is memcached a common thing as well to help with db load? or have people started using something new?
22:12 d4rkie joined #mojo
22:19 czinczar I got a copy of mr poe beginning perl, zomg operator rpecedence
22:19 czinczar i feel like latin class meorizing stuff
22:20 bpmedley Heh, perl is very epressive.. :)
22:22 czinczar you know I tried lisp for a while, but now I wana actually build a working website, maybe I was too dumb for lisp? I dunno
22:23 czinczar feel like a bit ofa failure
22:23 bpmedley So, are you new to perl and mojolicious?
22:25 tianon "Modern Perl" ftw <3
22:25 czinczar yes
22:25 bpmedley Cool.  What version do you have and what platform are you on?
22:26 czinczar I  am sick of being kicked around asa senior unix guy and wana make my own site, and think I have enuf of a brain and patience to do it..and mojo looks like it does 90% work for me...so win win
22:26 czinczar freebsd 10 perl 5.18.2
22:26 czinczar i386
22:26 czinczar :)
22:26 bpmedley Nice.  Do you want to tinker and get it to work, or do you want some guidance?
22:27 marty joined #mojo
22:27 czinczar I want guidance, I totally suck at programming.
22:28 czinczar in fact cpanm gave me some trouble so I ended up using cpanp
22:28 bpmedley Do you have Mojolicious installed?
22:28 czinczar yes I am able to get the hypnotoad verison of hello work going
22:28 czinczar on 192.168.1.68
22:29 czinczar er hello world
22:29 bpmedley Cool.  You might try morbo for development.  It will auto relaod when you make a change.
22:31 czinczar ah, ok
22:33 beyondcreed joined #mojo
22:40 mire joined #mojo
23:03 beyondcreed joined #mojo
23:20 punter joined #mojo

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