enkore / potstats2

pOTStats 2.0, ein pOTsches Informationsportal
https://potstats2.enkore.de
European Union Public License 1.2
4 stars 1 forks source link

Countdown zum pOT-crawlen #4

Closed enkore closed 6 years ago

enkore commented 6 years ago

Das Kerndatenmodell (User, Category, Board, Post) scheint soweit solide zu sein.

Dinge, die vorher erledigt werden müssen

Der Analytics-Teil ist im Grunde wurscht dafür, weil die Idee hinter Analytics ja gerade ist, dass man die alte Analyse wegwirft und eine komplett neue generiert. Deswegen sind Bugs in Analytics auch so schön einfach zu fixen - die versauen einem die Datenbank nicht (außer Bobby Tables, vll.)

enkore commented 6 years ago

Testlauf auf BID=18 ist jetzt im Gange.

enkore commented 6 years ago

Aktueller Stand

Merging updated posts  [##########--------------------------]  3463587/11956199  1d 19:33:01

Keine Timeouts gesetzt = Läuft einfach durch, wenn das Forum wegen des nächtlichen Backups nicht erreichbar ist. Nice :D

enkore commented 6 years ago
Merging updated posts  [####################################]  6549039/6271384              ... elapsed 59060.8 s

Statistics
----------------------> this session <--------------> total <---
API requests                  224353                 536146
Nomnom time                    59064                 169274
Added posts                  6285249               12595291
Added threads                      0                  63662
30063.86user 904.37system 16:26:05elapsed 52%CPU (0avgtext+0avgdata 118588maxresident)k
0inputs+0outputs (0major+512099minor)pagefaults 0swaps
enkore commented 6 years ago

Das hat jetzt insgesamt ~48 Stunden gedauert --- was ziemlich exakt die Erwartung war.

enkore commented 6 years ago
Schema |              Name              |   Type   |   Owner   |    Size    | Description 
--------+--------------------------------+----------+-----------+------------+-------------
 public | baked_poster_stats             | table    | potstats2 | 1856 kB    | 
 public | boards                         | table    | potstats2 | 16 kB      | 
 public | categories                     | table    | potstats2 | 16 kB      | 
 public | link_relation                  | table    | potstats2 | 8192 bytes | 
 public | post_links                     | table    | potstats2 | 8192 bytes | 
 public | post_quotes                    | table    | potstats2 | 0 bytes    | 
 public | posts                          | table    | potstats2 | 4566 MB    | 
 public | threads                        | table    | potstats2 | 7584 kB    | 
 public | users                          | table    | potstats2 | 832 kB     | 
 public | worldeater_state               | table    | potstats2 | 40 kB      | 
 public | worldeater_state_singleton_seq | sequence | potstats2 | 8192 bytes | 
 public | worldeater_tnu                 | table    | potstats2 | 528 kB     | 
enkore commented 6 years ago

Migration:

potstats2=> ALTER TABLE posts ADD COLUMN content_length INTEGER;
ALTER TABLE
Time: 0.845 ms
potstats2=> UPDATE posts SET content_length = length(content);
UPDATE 12595291
Time: 858684.240 ms (14:18.684)
potstats2=> INSERT INTO post_contents SELECT pid, title, content FROM posts;
INSERT 0 12595291
Time: 754126.753 ms (12:34.127)
potstats2=> ALTER TABLE posts DROP COLUMN content;
ALTER TABLE
Time: 17.028 ms
potstats2=> ALTER TABLE posts DROP COLUMN title;
ALTER TABLE
Time: 0.844 ms

 public | post_contents                  | table    | potstats2 | 4014 MB    | 
 public | posts                          | table    | potstats2 | 8985 MB    | 

potstats2=> VACUUM FULL ANALYZE posts;
VACUUM
Time: 110564.206 ms (01:50.564)

 public | posts                          | table    | potstats2 | 849 MB     |