|
if you know how to bold text on this forum then you're basically 50% of the way to knowing html
|
# ? Sep 18, 2013 16:27 |
|
|
# ? May 20, 2024 06:48 |
|
Tiny Bug Child posted:that said i have never once come across a legitimate use for eval in php you've never used create_function?
|
# ? Sep 18, 2013 16:34 |
|
Nomnom Cookie posted:you've never used create_function? no. that's old hacky php 4 poo poo, php has real closures now and has for a while
|
# ? Sep 18, 2013 16:35 |
|
this av change is really sealing the deal that tbc is just a shaggar alt account for me
|
# ? Sep 18, 2013 16:38 |
|
Tiny Bug Child posted:that is definitely a Weird Edge Case tho. one global db conn is best for most applications yeah this except the opposite it explains a lot about your lifestyle if your apps can survive on a single shared db connection
|
# ? Sep 18, 2013 16:54 |
|
Didn't PHP have a connection pool of some sort that the mysql driver interfaces used as a disguise, or is it just doing the silly thing of one native process per request and each one of them setting up its own connection? E: it's optional and barely used I guess. It used to be mysql_pconnect(), then it got deprecated for either mysqli_connect with a p: host prefix, or PDO with PDO::ATTR_PERSISTENT as a driver option when constructing it. These get the mysql drivers to set up 'persistent connections' and to reuse them when possible. Not sure it's any form of adequate pooling though. MononcQc fucked around with this message at 17:02 on Sep 18, 2013 |
# ? Sep 18, 2013 16:59 |
|
Notorious b.s.d. posted:yeah this except the opposite i don't know what kind of weird rear end environment you think is normal but "script starts a database connection, does db poo poo, ends, php closes connection" is how 99% of php scripts work
|
# ? Sep 18, 2013 17:02 |
|
how 99% of php scripts work should be an ad hominem
|
# ? Sep 18, 2013 17:04 |
|
Tiny Bug Child posted:i don't know what kind of weird rear end environment you think is normal but "script starts a database connection, does db poo poo, ends, php closes connection" is how 99% of php scripts work when you know 99% of your scripts/pages use a connection to the same DB, it's nicer to have a connection pool pre-warmed so that you do not need to have the overhead of negotiating a connection for every single concurrent page for every request. The pool will instead have the thing ready to serve directly and you'll gain in performance. Then again, most PHP applications have their bottleneck for the user in something like serving static assets over a limited number of domains/subdomains, or just not having a very well designed DB structure so the requests themselves are slow there.
|
# ? Sep 18, 2013 17:05 |
|
MononcQc posted:E: it's optional and barely used I guess. It used to be mysql_pconnect(), then it got deprecated for either mysqli_connect with a p: host prefix, or PDO with PDO::ATTR_PERSISTENT as a driver option when constructing it. These get the mysql drivers to set up 'persistent connections' and to reuse them when possible. Not sure it's any form of adequate pooling though. persistent connections are unnecessary, break things, and are definitely not commonly used in php
|
# ? Sep 18, 2013 17:06 |
|
we have a script that about 12 million uniques pass through a day that opens up two separate fresh db connections and it runs just peachy
|
# ? Sep 18, 2013 17:07 |
|
Because php can't implement connection pooling properly, just redefine what "best practice" is.
|
# ? Sep 18, 2013 17:08 |
|
That's because the PHP drivers for MySQL poo poo are terrible.
|
# ? Sep 18, 2013 17:08 |
|
well of course. they're mysql drivers and they're for php.
|
# ? Sep 18, 2013 17:10 |
|
I should have expected as much.
|
# ? Sep 18, 2013 17:11 |
|
MononcQc posted:Didn't PHP have a connection pool of some sort that the mysql driver interfaces used as a disguise, or is it just doing the silly thing of one native process per request and each one of them setting up its own connection? it's really bad back when i used php and r1 hosting was a thing r1ch im'd me to tell me to not use the pool because it was broken and leaking connections no fuckin' idea
|
# ? Sep 18, 2013 17:17 |
|
Shaggar posted:well of course. they're mysql drivers and they're for php. they're not "for" php so much as they're an integral compiled-in part of php
|
# ? Sep 18, 2013 17:19 |
|
Cocoa Crispies posted:i used php lol
|
# ? Sep 18, 2013 17:19 |
|
Tiny Bug Child posted:i don't know what kind of weird rear end environment you think is normal but "script starts a database connection, does db poo poo, ends, php closes connection" is how 99% of php scripts work If you got a huge swarm of users all at the same time, wouldn't you start hitting connection limits from the database?
|
# ? Sep 18, 2013 17:21 |
|
Hard NOP Life posted:If you got a huge swarm of users all at the same time, wouldn't you start hitting connection limits from the database? it turns out that the connection limit is a configurable number that you can make really high
|
# ? Sep 18, 2013 17:23 |
|
Tiny Bug Child posted:it turns out that the connection limit is a configurable number that you can make really high yeah i just set it to +Inf owned people who know poo poo about databases
|
# ? Sep 18, 2013 17:28 |
|
i'm not saying we didn't have to throw some pretty serious hardware at the problem, because we did, but you can't put a price on being able to write in the best language
|
# ? Sep 18, 2013 17:30 |
|
in all seriousness though i'm actually in the middle of redoing that one script so it doesn't open db connections at all and just passes messages to always-running processes that keep a connection permanently open. and when that's done i'll look like a genius for reducing our db usage by like a bazillion. who's the smart guy now yospos
|
# ? Sep 18, 2013 17:35 |
|
next step is to have more than one of these processes and pick any that is free. then you have actually implemented a pool.
|
# ? Sep 18, 2013 17:38 |
|
the process should have a pool behind it which would be good enough until you need more capacity
|
# ? Sep 18, 2013 17:40 |
|
Tiny Bug Child posted:in all seriousness though i'm actually in the middle of redoing that one script so it doesn't open db connections at all and just passes messages to always-running processes that keep a connection permanently open. and when that's done i'll look like a genius for reducing our db usage by like a bazillion. who's the smart guy now yospos not you
|
# ? Sep 18, 2013 17:41 |
|
Tiny Bug Child posted:i don't know what kind of weird rear end environment you think is normal but "script starts a database connection, does db poo poo, ends, php closes connection" is how 99% of php scripts work i wrote my last line of php in june 2011. i remember it like a quit date. if i had it my way, i would hand out tokens to my php support group like they do at AA if i ever encounter another php codebase that i gotta work on, i'm either moving it to resin/quercus or pushing it through the scala migration helper. in either case i would have a modern app server and connection pool and db driver and never have to deal with bullshit again
|
# ? Sep 18, 2013 17:47 |
|
Tiny Bug Child posted:in all seriousness though i'm actually in the middle of redoing that one script so it doesn't open db connections at all and just passes messages to always-running processes that keep a connection permanently open. and when that's done i'll look like a genius for reducing our db usage by like a bazillion. who's the smart guy now yospos the dude who just argued that connection pooling is unnecessary because php sucks at it....is making his own jerry rigged connection pool out of chicken poo poo and baling wire this can only end well
|
# ? Sep 18, 2013 17:48 |
|
tbc owns
|
# ? Sep 18, 2013 18:03 |
|
Notorious b.s.d. posted:the dude who just argued that connection pooling is unnecessary because php sucks at it....is making his own jerry rigged connection pool out of chicken poo poo and baling wire i mean, you're assuming that php's connection pooling is better than chicken poo poo and baling wire
|
# ? Sep 18, 2013 18:07 |
|
Dessert Rose posted:i mean, you're assuming that php's connection pooling is better than chicken poo poo and baling wire no i am definitely not assuming that in php, it's chicken poo poo all the way down till you hit turtles then poo poo gets uncomfortable
|
# ? Sep 18, 2013 18:14 |
|
Tiny Bug Child posted:i'm not saying we didn't have to throw some pretty serious hardware at the problem, because we did, but you can't put a price on being able to write in the best language Ah, that clears it up thanks
|
# ? Sep 18, 2013 18:14 |
|
Tiny Bug Child posted:it's like saying code doesn't count as pro python unless it has stupid interpreter-enforced formatting. this is true, though Tiny Bug Child posted:i'm not saying we didn't have to throw some pretty serious hardware at the problem, because we did, but you can't put a price on being able to write in the best language beautiful
|
# ? Sep 18, 2013 18:18 |
|
so I'm starting to read up on pig. is it just me, or was the design statement of pig 'we want the hideous syntax of SQL, but without all that boring, helpful abstraction'?
|
# ? Sep 18, 2013 18:19 |
|
I'm subscribed to the jdk8 dev mailing list, and this unbelievably stupid email about optional was just posted by one of the devs...quote:There is a good reason to not allow Optional to implement Serializable, Basically, lets cripple optional types because people might use them.
|
# ? Sep 18, 2013 18:53 |
|
more like cripple optional types because our language sucks and have to store everything as a pointer to a thing allocated separately on the heap but now for some reason we actually do care about cache efficiency jdk8 more like jok8
|
# ? Sep 18, 2013 19:04 |
|
Notorious b.s.d. posted:if i ever encounter another php codebase that i gotta work on, i'm either moving it to resin/quercus or pushing it through the scala migration helper. in either case i would have a modern app server and connection pool and db driver and never have to deal with bullshit again you're bug-chasing
|
# ? Sep 18, 2013 19:19 |
|
PleasingFungus posted:this is true, though yes, exactly. my point was that autoloading is just how you do it in PHP. he was drawing a parallel between autoloading and eval like autoloading was as gross as using eval, but they aren't comparable at all
|
# ? Sep 18, 2013 19:27 |
|
Tiny Bug Child posted:yes, exactly. my point was that autoloading is just how you do it in PHP. he was drawing a parallel between autoloading and eval like autoloading was as gross as using eval, but they aren't comparable at all the various shades of gross in PHP are hard to discern for normal people Zlodo fucked around with this message at 19:41 on Sep 18, 2013 |
# ? Sep 18, 2013 19:33 |
|
|
# ? May 20, 2024 06:48 |
|
has anyone tried julia yet? considering doing my next batch of research in it since I could contribute a few libs
|
# ? Sep 18, 2013 20:12 |