Progrider

Programming discussion

Posts by sam

19 public posts under this name. There are no accounts here: names are free text and anyone can type any name, so these may not all be the same person.

PostPosted
General · post #18

Still on it. See the STRICT tables thread, I ended up doing that as well.


by sam
Findings · post #2

Did this to my app too. You can't ALTER a table into STRICT so it's new table + copy. Took 20 minutes and found two bugs.


by sam
Help · post #1

Single node process, small API. I want to allow ~20 writes a minute per client and reject the rest. Everything I find assumes redis or a gateway. Is a Map of counters with a reset timestamp good enoug…


by sam
General · post #3

I use one for boilerplate and it's fine. If I couldn't explain the diff I wouldn't send it. It's the not reading it that's the problem, you're right.


by sam
Findings · post #2

So that's what that was. I'd "fixed" this in a script with verify=False last year. Going to go and undo that now.


by sam
Help · post #3

Yep, .env still said localhost. Changed to db and it connected. Resolved.


by sam
Help · post #1

Two services in docker compose, web and db. Web fails with ECONNREFUSED 127.0.0.1:5432 even though db is up and the logs say it's accepting connections. Works fine when I run the app outside docker. W…


by sam
Help · post #7

Down to 12GB, and the logging's capped now. Thanks.


by sam
Help · post #3

31GB of log for one container. wow.


by sam
Help · post #1

VPS started failing writes. du says most of it is /var/lib/docker. I only have four containers! How do I find out what it is and what's safe to delete?


by sam
Findings · post #3

So my maxlength on the HTML form is counting UTF-16 units?


by sam
Findings · post #2

The rule of thumb I was taught: equality columns first, then the range column. Anything after a range column in the index doesn't help that query.


by sam
Findings · post #2

Is that specific to Go? I'd assumed libraries set something sensible.


by sam
General · post #16

Update about ten days in. It's been boring, which is good. Hit one locked database error, it was my own fault, a batch import holding a transaction during an HTTP call. marta_k called that one exactly…


by sam
General · post #11

Ok this has been really useful. Going with SQLite, WAL, BEGIN IMMEDIATE on writes. One more: backups. Is a nightly .backup to another machine enough?


by sam
General · post #5

Point 1 is news to me, I'd never have found that. Does better-sqlite3 do that for you?


by sam
General · post #1

I keep reading both "just use SQLite" and "you'll regret it". Small app, a few hundred users at most, single VPS, mostly reads. It's a Node process. Postgres feels like one more thing to run and back …


by sam
Help · post #3

Second one. I edited the block for example.com and was testing against www.example.com, which falls through to the default server. Feel slightly stupid. Thanks.


by sam
Help · post #1

Set client_max_body_size 50m; in my site's server block and reloaded. Still 413 for anything over a meg. curl -v shows it's definitely nginx answering and not the app.


by sam
All times shown in UTC.5 topics, 14 replies