« first day (2474 days earlier)      last day (2699 days later) » 

09:24
So yesterday I discovered we were still running apache in prod even though we run fpm in dev/test - when I removed an "unnecessary" check for apache_request_headers
Todays fun task... migrate production to FPM \o/
Can you at least do it on a replicated server and use a subdomain?
Anonymous
I've just discovered praying. This is going to save me fucking millions in charity donations.
Found @tereško's mug
12
that's awesome
I actually want it now
very @tereško
09:36
:P
What is a fast way to execute 200k inserts?
Takes like 1000 seconds to insert that many
(I mean 200k reads and inserts)
@HassanAlthaf which rdbms?
MSSQL and MySQL.
Reads a format from an MSSQL database, makes calculations and stores it in MySQL.
can you expand on "makes calculations"?
Also is this a thing you need to do often or just a one-off/ad-hoc thing?
Quite often when the in-game item category changes/
09:47
You've tickled Dave's async fetish.
It takes data from a shit tonne of tables.
(with the same fucking schema)
@HassanAlthaf OK but that sounds like a thing that's done manually by a human?
it's over 200k records
lol
it also sounds like a poorly designed application...
yes it is
I'm sick of the app.
What they have done is make a hundred tables for different kinds of items.
They all have exactly the same format.
They could have just done one table and have an unsigned integer to tell what kind of an item it is...
09:49
2 mins ago, by DaveRandom
can you expand on "makes calculations"?
Yes.
So what it does is, it selects all rows,
if you can get mssql to do that for you, you can dump it out to csv and load data infile
Takes a few fields needed by the Game Control Panel (web based)
And translates some fields
And creates new fields out of them to be stored in the web.
How many records in the table? And are you doing this to move it to a better format?
@HassanAlthaf when you say "translates" you mean language translations or computations?
09:52
computations.
@Fabor 215887 to be specific
There's like a 100 tables.
I'm moving all of them to one.
With a few additional properties.
Then archiving off the old?
And that too from MSSQL to MySQL.
Not really to archive.
It's for the web app requirements.
I mean will you still use the MSSQL stuff after?
There's a few properties that are not stored in the Game database
Nope.
Not on the web side of things (where I work)
Game side of things will still use it.
200k isn't really a lot tbh.
Even at 1000 seconds (16 minutes) you'd take longer figuring out how to do it faster
09:56
It's something that needs to be done quite often.
Well when you have done the bulk you keep it up to date so it's not 200k each time
Otherwise profile for the slowest part of the process and begin there.
Well when you have done the bulk you keep it up to date so it's not 200k each time I haven't done it :(
This is what I'm doing.
Btw, my specs are good too. i5 6500 4 Core CPU
@ 3.2 GHz with 16 Gigz of RAM
CPU only at 20%
@HassanAlthaf This is not the bottleneck
it's network latency
oh
Well, both DBs are on my current local host machine.
So I
think that must not be too much
@HassanAlthaf Correct me if I am wrong. You said it'd take 1000s to insert. About 16 minutes to complete?
10:05
Yeah, 200k records
about 15 minutes ish
It's TCP overhead
Probably more on production server
How often will you have to keep this up to date?
since the MSSQL DB is on a Windows VPS for Game hosting
at least once a week?
How many new rows would that be?
10:06
A few.
NaN
So it would take hardly any time to do 5 rows.
10:08
@HassanAlthaf if you can write a T-SQL query that spits out a single data set with the additional data in it, dump it to a file (all doable in SQL) that can be read by LOAD DATA INFILE on MySQL, I would expect it to be a lot faster
Unfortunately, the additional data requires processing.
define "processing"
And the additional data is not stored in MSSQL
public function getCategoryForItem($itemCode): int
{
$list = ItemTypes::getIndex();

$code = substr($itemCode, 0, 2);

if (isset($list[$code])) {
return (int)$list[$code];
}

return -1;
}
@DaveRandom I'm just wondering whether a solution for a 1 time bulk import is faster to build than just running a slow 16 minute one.
And the production server is gonna be way more low spec than mine.
A dual core CPU with 512 MB RAM.
rocking ubuntu
10:11
@Fabor give him a week to come around to the idea
lol
@HassanAlthaf wow that is a shit database schema
512mb production -_-
where is ItemTypes stored? MySQL?
Is it a raspberry pi?
10:13
@DaveRandom An object
what the everloving shit
Let me pastebin
You saw it? Or want a pastebin
it's OK, I get the idea
hehe
It's some 2006-ish game..
Well the first thing you need to do is put that in a database
10:14
Which one, the index?
This is only used during inserts. And figured that it will be faster to have it in an object.
@Fabor Well, its 512 MB Production because there's no userbase. As the user base grows, the server will be expanded.
What you need to do is avoid having to do manual computations on it. I haven't seen anything so far that couldn't be done a lot faster by a database
Yeah, unfortunately, I don't think it would be possible.
There's more manual computations on the way.
The problem is that when you do it in code, you have manually cycle the rows and push them out one at a time. Databases can do this sort of thing waaaaaaay faster with joins
10:16
Is there any multi threaded way?
Or would it make zero difference?
It would make a difference, but it's the wrong approach
Wait a second
Due to small errors, the indexing failed twice.
lol
Finally done
So let's take that example you gave as a typical thing that needs to be done. You need to do two things, firstly you need to have that 2-character code (the thing produced by the substr() operation stored against the item row somehow, preferably by adding a new column to that table.
10:20
I think it will be best if we do monday again, and we'll have a crack at tuesday tomorrow ...
@JoeWatkins I wholeheartedly disagree, you are just artificially delaying the weekend.
You mean adding a column to the MSSQL DB table?
Then you can index that column, and SELECT items.*, itemcategories.categoryid FROM items INNER JOIN itemcategories ON items.itemcode = itemcategories.itemcode
Every think we'll get relative namespace support? use ..\Another\Namespace;
10:22
?
rinse and repeat
@Jimbo Lol if it is what I am thinking, I'd never want it.
@Jimbo what use is that?
@DaveRandom I had thought of that, nobody ever uses Thursday, we'll skip that ...
10:23
Save time writing the entire NAmespace
@DaveRandom We typically now use namespaces with a 1:1 mapping to directory structure, so they're effectively directories.
@Jimbo But imagine if someone is not using the PSR standard?
@JoeWatkins thursday is a thing here. it's kinda like friday except you're hung over friday.
Anonymous
!!wotd
litotes: understatement, especially that in which an affirmative is expressed by the negative of its contrary, as in “not bad at all.”
10:30
@Jimbo No.
anyone want to borrow a server? root@... password "secure"
lol
doesn't work
i wonder if someone "fixed" it for him
> Build complete.
Don't forget to run 'make test'.
I wonder if anybody ever runs all those tests
if you're talking about php ... about 5 people do
10:37
:P
and yes, im talking about php
I do, but ignore the result
@Jimbo yes but the only reason .. would be useful is if you were planning to change the root namespace...
we actually run them when we build php
but we ignore the results, yeah
madness
Number of tests : 15528             13088
Tests skipped   : 2440 ( 15.7%) --------
Tests warned    :    1 (  0.0%) (  0.0%)
Tests failed    :   33 (  0.2%) (  0.3%)
Expected fail   :   38 (  0.2%) (  0.3%)
Tests passed    : 13016 ( 83.8%) ( 99.4%)
(when building php7.2beta1)
heh
lots of failures because we don't have ipv6 in our kernel :)
Warning: fsockopen(): unable to connect to [::1]:9008 (php_network_getaddresses: getaddrinfo failed: Address family for hostname not supported) in /builds/vendor/php/sapi/fpm/tests/003.php on line 24
10:43
by the time you are building a release, the tests have been run hundreds of times already, for that release, in all kinds of environments ... it's pretty pointless for you to run them unless you are developing php ...
makes sense, I'll disable them
faster builds ¯\_(ツ)_/¯
if you are developing php, this is a clear sign that you are crazy and should seek help ...
so in either case, you are crazy ...
the default debian build runs the tests
I dunno what default debian build means ...
user4962466
what do you guys use to run migrations in the prod db apart from doctrine ?
10:46
apt-get source php && cd php && dpkg-builldpackage
does it also patch it ?
yeah
lots of patches
some that should be upstreamed, really
that's semi reasonable, since that's designed to run on their build infrastructure anyway ... it's not a bad idea to run tests if you are patching
I guess at one point the maintainer used to request pulls or provide patches and got bored of being ignored
ah yeah, makes sense
it's @JayIsTooCommon's fault
10:48
there's an interesting patch:
From f7924c6af9e71ad64f6fce9f269a6ee4f4567d21 Mon Sep 17 00:00:00 2001
From: Thijs Kinkhorst <[email protected]>
Date: Wed, 15 Jun 2016 09:18:03 +0200
Subject: Add patch to remove build timestamps from generated binaries.
helps to make the build reproducible
mostly removes __DATE__ and __TIME__ from the code
that's been discussed on list/github/somewhere
also things to make builds more portable like this:
--- a/ext/curl/config.m4
+++ b/ext/curl/config.m4
@@ -6,12 +6,14 @@ PHP_ARG_WITH(curl, for cURL support,
 [  --with-curl[=DIR]         Include cURL support])

 if test "$PHP_CURL" != "no"; then
-  if test -r $PHP_CURL/include/curl/easy.h; then
+  MACHINE_INCLUDES=$($CC -dumpmachine)
+
+  if test -r $PHP_CURL/include/curl/easy.h -o -r $PHP_CURL/include/$MACHINE_INCLUDES/curl/easy.h ; then
I closed it, they lost interest ...
morngnis
(not showing the full patch, but you get the idea)
10:50
yohaa
> Please take this action as encouragement
how often does it work out that way?
not often ...
@HassanAlthaf Then they don't need the feature. I genuinely don't know anyone who doesn't use auto loading in 2017.
$ php -v
PHP 7.2.0-dev (cli) (built: Jul 25 2017 15:48:11) ( ZTS )
\o/
11:02
@DaveRandom do review please and tell me if it's possible to add a test /cc @bwoebi
Anonymous
@JoeWatkins pfft, take note of the author @DaveRandom.
@JayIsTooCommon take note of the authors words, the ones where they asked chris to review it ...
Two wrongs don't make a wright
You're welcome
Anonymous
claps
Anonymous
@JoeWatkins I was getting at @bwoebi being suckish, you ruined it
11:06
@PeeHaa wow... that was .... a great pun
@JayIsTooCommon something about ruining you ... then something about being a bitch ...
Anonymous
heh, niiiceee
@JoeWatkins well it should be possible specifically to test whether the process receives a sigpipe (obv only testable when you can install a signal handler) but that feels like it's testing the wrong thing tbh
Environment variables set via putenv are not accessible via parse_ini_* – #74986
it's testing for a side effect of a problem rather than the actual problem
11:08
@DaveRandom can you do comments on the pr, so they in the same place, for the next time I come across it ...
a side effect that can occur for other reasons
@JoeWatkins will do when I have coherent thoughts, still organizing them
excellent, coherent comments are the best kind of comments ...
amen to that :-)
Hi. I have two radio buttons. I have set them value as 0 and 1. When I try to enter 1, the value 1 is saving in the database. When I try for 0, I get error.
Anonymous
and what is that error?
11:16
The error is some value is missing. When I try to put value 1 and 2, it is working fine.
When I try to 0, the value is not saving in the database
probably testing value for truthyness as pre-condition of executing query ...
Anonymous
@Orion that ^ share your code gist.github.com
I'm sharing wait
Anonymous
@JoeWatkins Hopefully he gets a transplant.
Hi chat. Whats wrong with that query?
UPDATE product_image SET source = http://shop.local/files/product/beltor-bcaa-v-tec-250g-cherrygrejfrut_450.png WHERE file = `beltor-bcaa-v-tec-250g-cherrygrejfrut_450.png
@user6827096 quotes
stackoverflow chat removed quotes
No they didn't
isset($g_data['multi_select'])
11:27
It removed backticks
thats your problem
and I used backtics
thanks
yes
!empty($g_data['multi_select'])
Anonymous
11:28
0, "0" are empty ...
Anonymous
@Orion ^
Sorry i wanted to copy the full line >.<à
isset($g_data['multi_select']) && !empty($g_data['multi_select'])
@JoeWatkins ping @bwoebi RE this
(meaning I want to talk to him)
11:33
you know we are two people, right Chris ?
I'm a people, and bob is a separate people
I think that the correct thing to do here to accomplish a graceful shutdown in true non-blocking mode is actually this:
correct
I tried to write code but it's complicated#
what you need to do is stream_socket_enable_crypto($sock, false) before you stream_socket_shutdown($sock)
That's the API that should be dealing with a graceful SSL_shutdown() in non-blocking mode
you need to explicitly shutdown SSL before shutting down the underlying socket
it's also an existing function that has a suitable API for reporting back when it has failed because there is not enough data
there is, however, still a problem with that API, in that really the application needs to know whether the reason is SSL_ERROR_WANT_READ or SSL_ERROR_WANT_WRITE
Also the existing implementation for shutdown in there is not up to the job: lxr.room11.org/xref/php-src%407.0/ext/openssl/…
that's the part that needs to be fixed
stream_socket_shutdown() is the wrong place to fix it
The true/false/0 return value has fucked us a bit tbh
uh-huh
11:42
Shot Caller looks like a good film. Basically same plot as "Felon"
Registry keys no longer valid – #74987
@Fabor Cannot unsee jamie lannister
heh true. Though I will give him a chance :p
Actually looks good
Indeed. Same director as Felon too.
11:46
I don't think I have seen felon
God I need my PC already. Keep getting stutters from the laptop :(
@PeeHaa Basically the exact same but older. Still a good watch
@PeeHaa can we (read: you) replace basically every instance of "character" on pages like php.net/manual/en/function.substr.php with "byte"?
Guys! Can someone indicate a software to make a come across in a PHP application. I need to compare two applications of the same version and see if there has been any change in the code.
git

« first day (2474 days earlier)      last day (2699 days later) »