log☇︎
77200+ entries in 0.701s
trinque: consider the case where a form is generated based on db state, and the validity of that form depends on db state
phf: mircea_popescu: rds is amazon's hosted relational database solution(tm) which is a postgresql on a unixbox
phf: well, it's also reason why the kind of stuff you could run on a beefy dreamhost now requires $5k/mo amazon rds instance
a111: Logged on 2016-12-30 17:56 mircea_popescu: jurov no ; but i am fine with wwwtron ocasionally reading a field that has meanwhile been updated, and giving old, of an unspecified age but less than x time.
mircea_popescu: there's a reason mysql owns the web, and that has to do with this very specific www-powered profile described above, http://btcbase.org/log/2016-12-30#1593729 ☝︎
phf: dirty read would definitely solve me a lot of headache now, though not enough motivation to switch to mysql. not so much when i worked on oracle for a g-sib where you want acid, so instead "avoid bad writes"
asciilifeform: and sometimes, cheap shaman is a disaster, and you want an actual surgeon.
asciilifeform: i pissed on 'db' concept as a student, and i piss today: custom data structure for each job! the year ~is~ 1972.
mircea_popescu: dude the fact that every other girl in your class is a slut isn't going to feed you or your baby.
davout: ok. imma give it a shot
phf: davout: you don't get consistent, uninterrupted, sequential chain of blocks. the actual distribution pattern is a mess, that "orphanage" was bandaiding
ben_vulpes: sometimes verifying a new block
mircea_popescu: filtering a chain out of the soup outside like BingoBoingo is not without merit.
davout: well, either a block verifies, or it doesn't
davout: asciilifeform: it does have a command that shits hex at me given a block hash
a111: Logged on 2016-12-30 17:40 davout: maybe i'm too lazy to script this and can live with waiting a month to sync!
davout: phf: you're saying postgresql doesn't have a "read uncommitted" transaction isolation level like innodb?
phf: well, "you either expect" is because ~sql~ as a db language is specified to have acid. there are databases that support dirty reads/writes they are just not "sql"
mircea_popescu: and i'm supposed to care about the fact that they don't know how to write a db that doesn't spit out passwd ?
mircea_popescu: and THIS is what i mean re "problems in the field". whopee, idiots who can't code still want to be "at the forefront of computing" so they made a modern db that doesn't work.
davout: jurov: i think it's more like nobody gives a shit if static wwwtron is out of sync with DB
mircea_popescu: jurov no ; but i am fine with wwwtron ocasionally reading a field that has meanwhile been updated, and giving old, of an unspecified age but less than x time. ☟︎
mircea_popescu: and here's exactly the problem of superficiality : "you either expect consistency or there's no point in discussing". there's LEVELS. maybe i expect all my writes to be consistent and don't care by A CLASS of reads being consistent. this is a consistency model that's consistent.
mircea_popescu: meanwhile inconsistency within the actual db are a different matter.
mircea_popescu: phf here's the problem : moder(field) consists of take field, redefine it in a practically useless but superficially persuasive way, then bad_words() to whoever dares ask if your "field" solves any important questions in the field. because of course it doesn't, MIT is the premier institution in science(*) and technology(*) in the werld. ☟︎
phf: you have your basic database requirements: atomicity, consistency, isolation and durability. these are axiomatic, you either expect them to hold or there's no point in further elaboration. at least SQL from the conception guaranteed the four requirements. "dirty read" violates consistency. your table might be half way through an update, you do a "dirty read", which is necessarily faster than update, and you have half the results with
davout: and re locking, how's a RDBMS to provide ACID guantees without locking?
mircea_popescu: because, again, a semaphore exists because the user does not know what the user is doing.
davout: maybe i'm too lazy to script this and can live with waiting a month to sync! ☟︎
mircea_popescu: o look, a precious block!
davout: so yeah, prb does have a way to dump a block to hex from a block hash, and a way to get a block hash from a height, looks like this could work
mircea_popescu: they have a new protocol.
mircea_popescu: phf think for a second : the whole FUCKING POINT of a semaphore, of any kind, is that user can't know what the other item involved is doing. if they could know, they wouldn't "avoid the locks", they'd avoid the bad write outright.
a111: Logged on 2016-12-30 16:14 asciilifeform: the fastest sync method, supposing one has access to a synced node, but also supposing that it won't do to simply copy the blocks (and it won't, you want to verify) is an eater-shitter system
davout: http://btcbase.org/log/2016-12-30#1593458 <<< vaguely rings a bell, does anyone have some pointers at hand so i can go read/re-read? ☝︎
phf: mircea_popescu: sop outside of mysql world. dirty read is considered a liability, so whole point of db systems design is to ensure that you don't hit locks when you shouldn't.
jurov: Flly lockless dirty read is likely a security hazard (due to race conditions, you may end up reading memory you ough not to)
phf: typically you handle it by not making your query lock the entire table, using a where clause of some sort. like if you're inserting things in batches, you can use a batch counter, and you query against max last known batch counter or less (or a variation of)
asciilifeform: mysql is a shitsandwich, and i will not touch it (it fucking CRASHES)
asciilifeform: mircea_popescu: it is currently a cached image, i implemented it. the cached snapshots however last for a limited time (iirc i have it set to half hr per url)
asciilifeform: phf, mircea_popescu , et al : one thing that would immediately make a very palpable difference in speed is if there were a permanent way to order postgres to perform all reads immediately, disregarding all locks.
mircea_popescu: asciilifeform as to "how to make www respond", you use the method we were discussing last time, whereby www is a cached image and if out of date tough for viewer ; as to nursery "do we have this ? how about this?" you really want the db to do that for you, it's ~the only thing it;s good for.
asciilifeform: mircea_popescu: point of 'nursery' was to do the 'do we have this fp? how about this? ...' a few thou. at a time, is all.
mircea_popescu: so : if loading the whole batches of keys through the user-wwwform process is what 99% of the machine time goes to, then yes, put the batches into a single, sorted query, make the workmem should be 256mb or 2gb or w/e it is you actually need to cover your query (yes this can be calculated, but can also be guessed from a few tries) and then run bernstein after every such query, on the db not on "nursery" (which yes, it's a ter
deedbot: http://phuctor.nosuchlabs.com/gpgkey/2398E0817D454688D06524E1B99CCE125A5E4D5E4DB5FBEFBE1BBE65BDA99AB4 << Recent Phuctorings. - Phuctored: 1730...1787 divides RSA Moduli belonging to '150.187.4.208 (ssh-rsa key from 150.187.4.208 (13-14 June 2016 extraction) for Phuctor import. Ask asciilifeform or framedragger on Freenode, or email fd at mkj dot lt) <ssh...lt>; ' (Unknown VE A)
phf: asciilifeform: no, it's a command that you run, like REINDEX index_of_things; it simply queries what's already in DB and warms up the cash
asciilifeform: holy shit was that a ... user submission?!
deedbot: http://phuctor.nosuchlabs.com/gpgkey/A07FCCF0D46AC8B25EB8F0982629537817E0CEA47BCC6C8B800A06F4F4647160 << Recent Phuctorings. - Phuctored: 7 divides RSA Moduli belonging to 'Todd A. Outten <out...om>; ' (host-95.215.85.243.ongnet.ru. Unknown)
asciilifeform: mircea_popescu: the other obvious thing would be to dispense with 'real time submission' entirely, and when someone dumps in a key, it goes into next batch. but we discussed this earlier in this thread, it would mean that the thing cannot be used as sks-like tool.
asciilifeform: phf: what means 'rebuild it on a crash'
phf: is it a hash index? it has the least overhead (it isn't logged amongs other things, so you have to rebuild it on crash, but conversly it's kept in memory and only supports = operation) indexes will make your queries more cheap, but writes more expensive, so you want to make sure it's the cheapest possible
asciilifeform: mircea_popescu: but yes, for next version (presently only exists in my notebook) there is a nursery and it gets merged into main table at night. but this makes for considerably more complex system, where there are two very distinct types of submission, 'realtime' and 'scripted' , and they get treated quite differently.
asciilifeform: and no, you can't query the nursery every time somebody loads a url, or you get SAME performance as now, omfg
phf: a sort of impolite question, but is there's an index on hash column?
asciilifeform: but what this adds up to is to have ~two~ quite separate phuctors. we wouldn't query the nursery, for instance, when someone keys in a url with a hash
mircea_popescu: this is a piddly excuse, "no duplicate logic", case of luser with wwwform and case of 100k keys in batch form are different enough to warrant duplicate logic. that's why computers even exist, to account for such level of difference in code.
mircea_popescu: yes, well, that's then the problem. they should go in as a single query the size of the batch, with the items sorted within it
asciilifeform: i dun give half a shit about 'image'. laying out the fact of why the thing is as it is.
asciilifeform: which is to say, rewrite of WHOLE thing. we had a thread.
mircea_popescu: asciilifeform if that's where it spends most time then a) http://btcbase.org/log/2016-12-30#1593462 is very likely to help and b) preparing your whole query as ONE single sorted item will help also. ☝︎
mircea_popescu: so a lot of hash search.
phf: i'm not even arguing with you, i'm saying that the ~full extent~ of what "move it to psql" is going to do is ~eliminate cross-boundary issue~ that is all. so it'll shave some significant overhead, but it's not a silver bullet.
phf: precompiled queries are a fraction of cross-boundary issue
phf: what i'm saying is that a significant fraction of "1000s of queries AND ..." is the cross-boundary. you compile queries on c side, you send them to psql, it then parses, prepares results, serializes, sends it to c side, c side has to now parse all over again
mircea_popescu: well, it was a thought.
phf: well, a more practical approach would be to adapt phuctor c part to a postgresql loadable module interface. in which case you he will eliminate the cross-boundary overhead (serialize/deserialize over the "wire").
asciilifeform: a sql or similar db system with built-in bignumatron could be useful and interesting. but no such thing exists. nor would it solve the actual bottleneck in phuctor if it were to be discovered tonight.
asciilifeform: i for one do not expect to live long enough to make a serious attempt at such a thing.
asciilifeform: mircea_popescu: if you think trb is a hard nut to crack, picture reading, grasping postgres.
mircea_popescu: you're not addressing the idea. currently you use a pile of c code you labeled for purely personal reasons "a db" to store some data for you, and another pile, you labeled phuctor, to bernstein and do other things on the db-stored data. because the interface is the bottleneck, it then becomes clear you must merge this. one way is to merge by lifting the db code and putting it into phuctor, making it you know, its own db like
mircea_popescu: not a matter of access
asciilifeform: so it has not been a priority, because batching will tremendously complicate the moving parts.
mircea_popescu: and you do it as prepared queries, which get precompiled to a degree
trinque: asciilifeform: a temp table is in RAM
asciilifeform: mircea_popescu: sql doesn't have a bignumatron
phf: asciilifeform: oh so you do insert to a set, every time there's a result, and you query for the whole set before you start a cycle of process?
mircea_popescu: you implement bernstein IN the db. it is actually a programming language.
asciilifeform: mircea_popescu: it's a screaming nope
mircea_popescu: trinque 's idea, bernstein as prepared queries, may be a gain.
asciilifeform: this, by all rights, ought to be a batch query. and probably will be in next version.
asciilifeform: phf: nope. the only thing that happens to db as a result of bernsteinization is N queries 'do we already know this factor'
asciilifeform: the db absolutely has to be in a consistent state at all times, or 0 phuctoring takes place.
mircea_popescu: and work_mem should prolly be larger than 4mb, but hard to guess how large without a profile, and this is a major resource consumption ticket, so you actually want to do some maffs.
mircea_popescu: asciilifeform do you use a lot of temp tables ?
asciilifeform: (because apparently 'thousands of queries / sec is abuse, get a cluster' is the 'state of the art')
mircea_popescu: alrighty then let's make a full plan here.
asciilifeform: the fastest sync method, supposing one has access to a synced node, but also supposing that it won't do to simply copy the blocks (and it won't, you want to verify) is an eater-shitter system ☟︎
mircea_popescu: incidentally asciilifeform since we're now doing open source db optimization shared_buffers is probably a larger concern. what is it ? defaults to 125mb but i'd readily see it 1-4gb in your case.
a111: Logged on 2016-12-30 14:20 asciilifeform: i even spoke with career dbists, answer was 'your application is monstrous abuse and you need a cluster'
a111: Logged on 2016-12-30 12:28 davout: was there a discussion of the use case where one wishes to create, and sign transactions from an arbitrary set of unspent inputs?
mircea_popescu: if he weren't a total fucking retard on top of being a consumate conman, he'd actually have 30k to buy an isp now.
mircea_popescu: and for the record : the dood colluded with sonny vleisides / the rest of the 'ndrangheta running "bfl" scam (which, obviously, the usg hasn't ever prosecuted, in spite of loud violation of, eg, parole termas, because hey, partners in crime) to falsely claim that he received a miner delivery so as to scam bitbet into misresolving a bet, on which they had ~500 btc.
asciilifeform has a relative who, until recently retiring, programmed in PL/I ! i shit thee not
mod6: when I get a free moment, i'll throw the latest eulora on there. can be my mining box. :]
mod6: oh, hey, actually. so I've got a box.
diana_coman: got to some snow, sledged downhill, even bruised a knee , got back to peaceful coding now , lol
mircea_popescu: asciilifeform planeshift is a mmorpg that the many-eyes beast took 10 years to make. it uses cs which is a sort of game engine, which is built on cal3d which is a gfx lib.
diana_coman: planeshift asciilifeform , a swamp not worth gettting stuck into
asciilifeform: well here's one typical scenario, i find a pgp-signed historic patch (e.g., linus) and want to see what vintage key etc
asciilifeform: it's a total replacement (if slow) for sks.