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

IRC log for #mojo, 2016-03-29

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

All times shown according to UTC.

Time Nick Message
00:00 jontaylor joined #mojo
00:19 meshl joined #mojo
00:52 bpmedley What are people using for deployment?  The mount plugin and straight hypnotoad are working for me..
00:56 s1037989 bpmedley: Toadfarm
00:56 bpmedley s1037989 : Cool, how does that work out for you?
00:56 s1037989 Great!!
00:56 s1037989 I've been absolutely loving it!
01:00 jontaylor joined #mojo
01:07 irqq_ joined #mojo
01:38 Kripton joined #mojo
01:40 jberger So about those iphones
02:00 bpmedley What was the issue with them?
02:05 Vitrifur joined #mojo
02:35 jberger FBI cracked it without apple after all
02:35 sri so, i guess the vote count is -1 so far https://github.com/kraih/mojo/issues/941
02:36 sri jberger: apparently some israeli company has an exploit
02:36 genio That makes me sad.
02:36 sri which is not too surprising considering it's an old iphone
02:37 bpmedley Ahh, that.  There is a disparity between the masses and the electoral vote, at present.  I wish the us had internet voting.
02:39 sri it's actually quite funny, because it illustrates perfectly how backdoor will not just serve american interests
02:39 sri *+s
02:47 noganex joined #mojo
02:56 jberger sri: How bad is the performance hit?
02:56 jberger I actually have a use case for it at work it seems
02:56 sri jberger: run this yourself https://github.com/kraih/mojo/issues/941#issuecomment-202318305
02:57 sri we need more data points
02:57 sri for me it's about 1% average over a few runs
02:59 jberger I'm not at a computer atm but I'll do it in the morning
03:11 bpmedley https://metacpan.org/source/WBRASWELL/PhysicsPerl-0.100000/README.md <-- No idea who would use this.. ;)
03:15 bpmedley https://gist.github.com/brianmed/94c4c0d076581ebb20b9
03:18 jberger RPerl is fancy c
03:22 s1037989 3 different boxes: https://gist.github.com/s1037989/b2371c26b7ee06fedeea
03:24 sri it's odd how sometimes the second one is faster
03:24 sri maybe something else was running in the background?
03:26 sri jberger: with only you, batman and me voting atm., i guess the proposal is rejected already :S
03:27 jberger I'm guessing that batman's vote is contingent on the performance hit
03:27 jberger Let me run my tests in the morning
03:27 sri well, the performance hit is definitely confirmed
03:27 jberger Of course is gonna cost some performance
03:28 jberger I'm just curious how much
03:28 sri data from bpmedley and s1037989 seem to confir the 1% average
03:29 * sri would not even trust a single source with different results ;p
03:30 inokenty-w joined #mojo
03:30 jberger Oh well
03:30 sri oh cool, postgis will also be a lot faster with postgres 9.6 http://blog.cleverelephant.ca/2016/03/parallel-postgis.html
03:37 s1037989 sri: the 2nd box, listed as just mojo, is a very idle box.  It has postgres, nginx, and toadfarm processes running, but it gets 0 activity.
03:38 s1037989 22:38:07 up 105 days, 22:20,  1 user,  load average: 0.00, 0.05, 0.13
03:43 bpmedley https://gist.github.com/brianmed/710ab70cf225fd121363 <-- Sooo, what about launching Minion from a Mojolicious::Lite app?  :)
04:05 s1037989 bpmedley: I would really like to have Minion workers launched from a Mojo app!  Can you make that code into a plugin or something??
04:06 bpmedley s1037989 : I'd need a blessing from a core member so that I can be sure the code is technically sound.. :)
04:09 s1037989 I hope you get it!  How do you manage your Minions now?  I do it with `sh -c 'perl app.pl minion worker &'` which just seems weird...  And then my morbo auto restarts when I update my code, but not minion workers...  And I have a toadfarm with a dozen or so mounted apps, what if they each had their own Minions?  How would I manage them all?
04:13 bpmedley s1037989 : I use upstart .. https://gist.github.com/brianmed/d19395836761614d3a44
04:13 bpmedley I know nothing of ToadFarm.. hrmm
04:14 s1037989 So you have a separate upstart for each app's minions?  (Assuming you're concerned about more than one app)
04:14 bpmedley s1037989 : Yes
04:15 bpmedley s1037989 : $ sudo ln -s /opt/callsabound.com/bin/upstart_callsabound.minion.conf minion_000.conf
04:16 s1037989 Toadfarm is just a really advanced use of the Mount plugin.  It routes requests to the appropriate mounted app based typically on hostname.
04:16 bpmedley minion_001, 002, etc
04:18 bpmedley s1037989 : Does the methodology make sense?
04:18 s1037989 Cool!  Good to know that method works for you!
04:19 jontaylor joined #mojo
04:19 s1037989 Of doing Minions by upstart?  I think so...  minion_001, 002, etc...  Is 001 and 002 etc the minions for totally separate apps?
04:20 bpmedley Or, 2-3 minions for one app
04:21 s1037989 2-3 minions for one app...!  Ah, yes, I forgot, you keep calling minion is often as you like.  I haven't used Minion a whole lot yet.  I have this thing in my mind that I should be able to run it like `perl app.pl minion worker -w 4` and it launches 4 workers.  :D
04:21 bpmedley The same conf file can be used to launch multiple minions and be managed by upstart separately.  Just using symlinks.
04:22 s1037989 So if you have 4 workers and then update the code, how do you restart all your workers?
04:23 bpmedley s1037989 : Are you familiar with --jobs?
04:23 s1037989 Negative.
04:23 bpmedley s1037989 : It's a manual process.  Sometimes I just restart the server.. :-P
04:24 s1037989 You restart ... the OS??
04:24 bpmedley $ /opt/perl app.pl minion worker --help
04:25 bpmedley s1037989 : It's just a dev box.  My playground, so I do things with it that I can't do in production.
04:25 s1037989 :D  Still seems excessive!  That tells me there must be a better way!  :D
04:27 s1037989 Ok, I ran with -j 4 and I still just have one worker process.  Will it spawn additional subprocesses as necessary?
04:27 bpmedley Yuppers
04:27 s1037989 Oh cool!  :D
04:27 s1037989 I thought I was to launch perl app.pl minion worker as much as I wanted.
04:27 bpmedley Minion is really flexible with its primitives
04:28 bpmedley For example, you can have a few queues.  Say "audio" and "video" and "email".  You could run three minions with --queue for each.
04:28 s1037989 Which signal is the best signal to end the worker?  -9 is also excessive, but that's my typical M.O. there.  :D
04:29 s1037989 Oh, I see, that's the reason so separately launch Minion worker processes.
04:29 s1037989 That's very and awesomely flexible!  Love it!
04:30 bpmedley s1037989 : The signals SIGKILL and SIGSTOP cannot be caught, blocked, or ignored.
04:30 bpmedley So, I'd use a SIGTERM or similar to allow for cleanup code to run.
04:30 bpmedley s1037989 : One queue can be for priority users (paid users).
04:31 s1037989 I like the idea behind that!
04:31 bpmedley s1037989 : May I ask what apps you work on?
04:32 s1037989 I lot of half-baked, half-finished ones...  :D  http://be.gl to anonymously share your location with others.
04:32 bpmedley Cool, I saw be.gl the other day.  Neat'o.
04:33 sri if there was a safe way to start and stop minion workers from the mojolicious app, it would be part of Mojolicious::Plugin::Minion
04:33 s1037989 I have a handful of things I'm in and out on with $work.  Right now I'm building an app to receive notifications that can only be delivered by SMTP and then store and forward that SMTP notification.  Will eventually blend SNMP and Syslog notifications into it as well.
04:34 sri just because there's a million ways to hack it in and get it to somehwat work doesn't mean that it's safe
04:34 bpmedley sri : May I ask which part of my code is unsafe?
04:34 s1037989 sri: And by that you mean that there isn't a safe way to do it?
04:34 sri bpmedley: can you say it is safe?
04:34 sri i have not found one yet
04:35 bpmedley I can't say the code is safe without knowing most of the edge cases, which I do not..
04:35 sri exactly
04:36 sri and then you have stuff like hypnotoad restarting itself all the time
04:36 sri or morbo where the app is loaded in the worker process
04:36 bpmedley I should have mentioned.  I only was targeting "daemon" and "prefork".
04:36 sri prefork vs daemon... there's so many edge cases
04:37 sri most people don't deploy with daemon/prefork
04:37 bpmedley The Daemon code is a marvel of edge cases comprising 30 years of unix/linux history.. :)
04:37 s1037989 sri: Is it possible / safe to do something like perl app.pl minion worker -s (which would stop the worker)?  Because otherwise to stop the worker, I need to know its pid, right?
04:38 sri s1037989: there is no pif dile
04:38 sri pid file
04:38 s1037989 Oh, a pid file would be necessary to support a -s concept?
04:39 sri yes
04:39 s1037989 Good to know!
04:40 sri just look at the hypnotoad code
04:41 s1037989 Ah yep, that makes sense.  Because if I ran `perl app.pl minion worker -s` all I'd be doing is launching a new process!  How would it know what pid to kill without a pid file??
04:42 sri thinking some more about it, i guess a morbo worker plugin that can handle morbo and hypnotoad is possible
04:43 sri you might have to do fancy stuff like using a pipe to signal to the worker that its parent went away
04:43 bpmedley s1037989 : $ kill $(perl minion.pl minion job -w | perl -nE 'say($1) if m/:(\d+)/')      <-- Would that suffice to kill all running workers?
04:43 sri certainly not the way bpmedley has done it though
04:44 sri s/morbo/minion/
04:46 s1037989 bpmedley: Yep!  Easy enough to put that into a bash function or something.  Thanks!
04:46 sri would require lots and lots of trial and error though, prolly not worth the effort
04:49 sri bpmedley: that doesn't do anything https://gist.github.com/brianmed/710ab70cf225fd121363#file-mojo_minion_launch-pl-L39
04:49 sri you localize and leave the scope immediately
04:49 bpmedley Are you saying the unregister is not called?
04:51 s1037989 I guess what I like about it -- and I get that the stupidity is my own -- is I've found myself more than once struggling with debugging my code because my app and worker aren't sync'd.  i.e. I start the app but forget to start the worker, or I change a minion task which triggers morbo to restart but I forget to kill and start the minion worker.  Does that make sense?  Is that just something I need to get better about doing correctly in the future?
04:53 sri s1037989: no, that's a reasonable concern
04:54 sri which might be easily fixed with "Mojo::IOLoop->recurring(1 => sub { app->minion->perform_jobs }) if app->mode eq 'development';"
04:55 s1037989 Is that a fix if I haven't started a worker?
04:56 sri it runs a worker inside your morbo server
04:56 asarch joined #mojo
04:56 s1037989 Oh!  Nice!!
04:56 sri http://mojolicious.org/perldoc/Minion#perform_jobs
04:57 s1037989 Yeah, that didn't indicate to me that it runs a worker inside your morbo server.  I thought it was just communicating back to a running worker that it should go ahead and do its thang.  :)
04:57 bpmedley sri : Egads, I had improperly used scope on that code..
04:58 s1037989 Would it make sense to put that fix in the Minion plugin?  Or does that really belong separately in each app?
04:58 sri it's not a "fix"
04:59 s1037989 :D
04:59 sri i'm not even sure if it's the right implementation
05:00 sri some job queues also just process the job right away when it is enqueued in a dev environment
05:02 sri for that you'd just do "app->minion->auto_perform(1)"
05:02 sri and it would process every job that gets enqueued from your app immediately
05:07 sri updated with some more information http://mojolicious.org/perldoc/Minion#perform_jobs
05:08 s1037989 "Perform all jobs with a temporary worker"  ++
05:09 sri oh, the longer version was sloppy of me
05:09 sri still got the $self
05:11 sri and fixed
05:16 bpmedley sri : Would it be useful to extract parts of "run" and "_work" from Minion::Command::minion::worker?  This would so that a minion could be launched via the server commands.
05:17 sri i've thought abou it, but got annoyed when i thought about the tests i would have to write
05:20 jontaylor joined #mojo
06:12 genio joined #mojo
06:24 * sri kinda would like to play a civilization game again
06:24 sri the first beypnd earth expansion any good?
06:25 Lee joined #mojo
06:25 dod joined #mojo
06:27 salva joined #mojo
06:28 s1037989 Civ 2 was my favorite game!  :D  That and Warcraft 2.
06:28 Vandal joined #mojo
06:29 sri got civ 5, and wonder if i should just get all its expansions, or try beyond earth instead
06:30 dod joined #mojo
06:34 Shaeto joined #mojo
06:40 McA joined #mojo
06:55 batman sri, jberger: i don't mind if we add sort() to #941. i'm just not eager on adding it.
06:56 sri batman: doesn't that make you a neutral vote?
06:56 batman i still think it's stupid :(
06:59 sri hmm, lots of mac games on sale this week :o
06:59 batman so... "stupid" might not be the best argument for keeping my negative vote..?
07:01 Lee predictable and repeatable output is favourable if the overhead is negligible
07:02 Lee and i have no doubt that this issue will just come up again and again :)
07:02 sri everyone feel free to vote on https://github.com/kraih/mojo/issues/941
07:04 Grinnz_ joined #mojo
07:06 sri and now i wonder if that is now a breaking change
07:06 sri lol
07:06 sri because someone might be using ordered hashes
07:06 batman when does json care about order?
07:06 Lee wouldn't they be sorting the output anyway if they were?
07:06 sri like the tied hash implementation from Mango i recommended ;p
07:07 sri Lee: no, we had one case where someone wanted a custom order, with some id as first key
07:07 Lee heh :)
07:09 * Lee has seen too many hash key ordering bugs to think having sorted output is favourable, but i understand the performance gain might be worth it
07:09 Lee i'm pretty agnostic on this TBH, but can see other's POV
07:10 Lee s/might be/might not be/
07:10 Lee that was badly worded haha
07:11 sri performance gain is 1%
07:12 Lee on large json content i would assume?
07:12 batman Lee: there's a test case in the issue
07:12 Lee oh yeah
07:13 Lee yeah i think that's pretty chunky
07:13 Lee i imagine the difference isn't going to be measurable for most cases
07:14 batman my results: https://ssl.thorsen.pm/paste/2d2ce24b17de
07:16 batman but "how much slower" is not why i have a negative vote. i have my vote because i don't see any killer argument for adding sort()
07:17 sri yea, especially the testing with eq instead of is_deeply is a very weak argument
07:17 batman +1
07:17 batman that could be the dumbest argument :(
07:17 * batman takes that back
07:17 batman sorry. not nice to say "dumbest"
07:18 sri considering it's utf-8 encoded, so binary data, yea, it's not a clever argument
07:19 sri eq testing should not be recommended ever imo
07:19 sri i imagine he was tageting the novice audience with that argument
07:20 sri especially there it's not good at all
07:21 jontaylor joined #mojo
07:23 batman the debug argument is also not very good imo. whenever i need to debug my json data, i use "json_pp" or something like https://chrome.google.com/webstore/detail/jsonview/chklaanhfefbnpoihckbnefhakgolnmc
07:24 batman so... my strategy for caching is to have something that makes the object unique and then create an etag based on that. the middleware can very well be aware of that etag
07:25 batman like an object ID and a last-updated-timestamp...
07:25 batman i suppose that makes it faster to do HEAD requests as well -- if anyone does that :)
07:26 osfabibisi joined #mojo
07:29 jontaylor joined #mojo
07:31 sri the caching argument is the best, not particularly strong, but reasonable
07:34 batman But are my counter argument too weak for a negative vote?
07:36 batman If so, I will change to neutral, but I want the sort() change to be reversible if someone has tied hashes.
07:36 sri that's not gonna happen
07:37 sri i'd -1 a check for tied hashes
07:40 AndrewIsh joined #mojo
07:43 batman s/want/would like/
07:43 batman sri: oh! what i meant is that we can revert the commit where sort() was added
07:43 batman not an additional check
07:44 sri oh
07:44 batman like make the sort EXPERIMENTAL in case someone complains
07:44 sri you mean not mention it in the docs
07:44 batman yeah -- or that ^^ :)
07:44 sri that's pretty much my old commit
07:44 batman yup
07:45 sri https://github.com/kraih/mojo/commit/122f3803e998bd17426936fab280587105c68252
08:00 trone joined #mojo
08:01 sugar joined #mojo
08:15 irqq joined #mojo
08:18 trone joined #mojo
08:23 orev joined #mojo
08:40 ashimema joined #mojo
09:08 meshl joined #mojo
09:39 irqq joined #mojo
10:17 kes joined #mojo
10:33 jontaylor joined #mojo
10:46 dvinciguerra__ joined #mojo
11:15 Kripton joined #mojo
11:22 Kripton joined #mojo
11:37 kaare joined #mojo
11:42 bpmedley So, if an auto launching minion is desired, when should that be started?  Should the auto launching only be considered for a Prefork server?
11:44 batman i think minion should have a separate init/startup script
11:44 bpmedley batman : Should that be the only way minion is started?
11:44 batman not sure if i understand the question.
11:45 batman i think using systemd to start minion should be very simple, since minion is a foreground process and you can start as many as you want
11:45 batman (hope i have understood it correctly)
11:46 bpmedley Sure, lets say I have a Mojolicious::Lite app and desire to start and stop a minion worker and the app server with one command.  Is that something that would be useful?
11:46 nic I guess you could have a minion spawned by (x)inetd
11:47 pink_mist bpmedley: isn't that just a matter of writing a very tiny shellscript?
11:47 nic <disclaimer>hmm, can't get my head around how that could be achieved tho
11:47 batman bpmedley: i don't think it would be useful with one command, but that's my personal opinion
11:48 batman but it could be useful for easier installation/trying out apps
11:48 batman like $ curl http://install.app.example.com/ | perl - daemon
11:48 batman s/http/https/
11:48 bpmedley pink_mist : Yes, one shell script is all that's required.
11:50 bpmedley However, can the common case of a minion worker and one prefork'ing web server be made significantly easier?
11:50 bpmedley Imagine a new user that downloads a lite app and just runs the app.  No install, nothing.
11:51 bpmedley batman : Wowzers, I never thought about using curl to do that.. :-0
11:51 batman bpmedley: yeah... i take back "don't think it would be useful" :)
11:51 jberger bpmedley: how do they even configure their minion backend?
11:51 jberger Even if it auto performs it still needs a database
11:51 batman bpmedley: that's why i made https://metacpan.org/pod/App::Implode ... want to use that with convos for easy testing
11:52 bpmedley batman++
11:52 batman jberger: smart defaults :)
11:52 bpmedley jberger : I'm only advocating auto starting if the Minion plugin is used.
11:53 jberger bpmedley: sure, but you want zero effort initial run
11:53 jberger Do how do you connect to their database
11:53 jberger So
11:53 bpmedley jberger : Are you referring to the time and effort required to starting a database?
11:54 bpmedley jberger : I'm assuming something like SQLite
11:54 batman jberger: https://metacpan.org/pod/Minion::Backend::SQLite ?
12:09 bpmedley be back later
12:20 meshl joined #mojo
12:27 jberger I guess since you don't need to rely on the sleep/wakeup in that case maybe you are right
12:32 * sri thinks he will just try borderlands 2 :)
12:32 sri brb back in a few months ;p
12:32 pink_mist lol
12:35 ZoffixW joined #mojo
12:40 jberger so what was the final ruling on firewatch? did people like it
12:40 jberger it looks interesting to me
12:40 sri yea
12:40 sri i'll wait until it's on sale though
12:41 sri seems too short for the price
12:41 jberger what's the play time?
12:41 neilhwatson joined #mojo
12:41 sri only about 6 hours apparently
12:42 sri some people even say 4
12:42 jantore six hours on my end, with a lot of time spent enjoying the scenery
12:42 jantore so yeah, waiting for a sale is a good idea
12:43 * sri will just get a bunch of random steam keys from this sale for now and refresh his library a bit :) http://www.macgamestore.com
12:43 trone_ joined #mojo
12:44 sri if only there was more bioshock
12:44 sri love that kind of story driven shooter
12:47 jberger anyone played Homeworld: Deserts of Kharak yet?
12:50 * sri has not even played the original :o
13:00 cpan_mojo Mojolicious-Plugin-AutoRoute-0.22 by KIMOTO https://metacpan.org/release/KIMOTO/Mojolicious-Plugin-AutoRoute-0.22
13:01 sri i do like the thought, but the actual code looks pretty bad when run through perltidy https://github.com/kraih/mojo/issues/941#issuecomment-202849040
13:03 asarch joined #mojo
13:04 Lee sometimes fast ain't pretty :D
13:10 nic I might need that on a t-shirt
13:11 batman sri: sorry for commenting. didn't notice you had closed the issue :/
13:11 batman s/issue/PR/
13:12 sri closed it right after you commented :)
13:12 batman ok :)
13:33 marty joined #mojo
14:14 skhomutov joined #mojo
14:22 skhomutov left #mojo
14:28 jberger sri: do you have that good http/2 article link handy?
14:28 jberger I thought I had bookmarked it
14:28 jberger can't find it now
14:34 jberger this one? http://http2-explained.haxx.se/content/en//
14:48 anparker https://github.com/kraih/mojo/issues/423#issuecomment-171356341 - there're links in comment to issue about http/2
14:49 jberger anparker++ thanks
14:49 jberger shoulda looked there
14:49 jberger so yeah, same book
15:16 CHYC :339
15:27 PryMar56 joined #mojo
15:34 crux joined #mojo
15:35 lluad joined #mojo
16:00 inokenty joined #mojo
16:17 csson joined #mojo
16:24 Kripton joined #mojo
16:47 jb360 joined #mojo
16:52 disputin joined #mojo
17:14 dod joined #mojo
17:19 Kripton joined #mojo
17:25 kaare joined #mojo
17:35 meshl joined #mojo
17:46 marty_ joined #mojo
18:25 jontaylor joined #mojo
18:31 cpan_mojo Mojo-SlackRTM-0.01 by SKAJI https://metacpan.org/release/SKAJI/Mojo-SlackRTM-0.01
19:08 batman Does anyone use twitterific in iOS? Clicking on links just opens a white page
19:10 pink_mist maybe you've been hit by https://bencollier.net/2016/03/unable-to-open-links-in-safari-mail-or-messages-on-ios-9-3/ somehow?
19:12 batman Hm... Wonder if that's why I can't open links in chrome either :/
19:13 batman Thanks!
19:18 batman Oh. My. 😱
19:21 irqq joined #mojo
19:34 jberger thanks booking
19:50 jberger sri: one more possibly dumb question about Mojo::Pg
19:50 jberger is there an obvious way to see update success?
19:51 jberger I guess I could use returning 1?
19:54 stephan48 jberger: maybe check the result of query()? Theoretically rows() should contain what you want
20:06 glauber joined #mojo
20:24 disputin joined #mojo
20:38 batman jberger: what stephan48 said. "Returns the number of rows affected by the last row affecting command, or -1 if the number of rows is not known or not available."
20:39 stephan48 yup
20:40 jberger batman: where do you see that?
20:40 batman i must say what booking did was pretty stupid.
20:40 jberger https://metacpan.org/pod/distribution/DBD-Pg/Pg.pm#rows
20:40 batman jberger: that's the same as $res->sth->rows
20:40 batman or https://metacpan.org/pod/DBI#rows
20:40 stephan48 yup
20:40 jberger Ah
20:41 jberger DBD Pg doc leaves something to be desired there
20:42 batman indeed. i think it should link to the DBI doc
20:43 stephan48 documentation? whats that?
20:43 stephan48 can you eat it?
20:48 batman itunes could be the most awful piece of software i've ever encountered
21:01 genio really?  it works for me.
21:07 orev it's pretty crappy on windows
21:09 batman most of the versions crash after just a few seconds
21:09 batman ...if i have wifi enabled :S
21:10 jberger in lock-in markets once you have enough marketshare there is no return on investment for continued development (or even maintenance)
21:10 jberger see also the windows os generally
21:34 meshl joined #mojo
21:48 batman disabling proxy settings makes itunes stay alive :(
22:20 geheimnis` joined #mojo
22:20 vicash batman is this on osx or windows ?
22:21 vicash batman: on osx you have to setup proxy usage in the Wifi Advanced Settings. there will be a tab called Proxies. On Windows iTunes should use IE proxy settings
22:22 vicash batman: here is an example for Wifi proxy adjustments: https://apple.stackexchange.com/questions/96762/macbook-air-how-to-setup-proxy-for-itunes-and-app-store
23:02 bpmedley joined #mojo

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