So... I am no longer blind about performance here ...



  • Meh, IDRGI. Trolling around here seems pretty ubiquitous, so why would it be any different if it's @codinghorror trolling?

    (Also, I'm gonna watch the talk in question. After all that guy is speaking in a steam punk costume.)



  • @xaade said:

    warehouse

    But what about whorehouse likes?

    @codinghorror said:

    just not as much as the people that pay us actual money

    See, thats all we need to hear ๐Ÿ˜


  • ๐Ÿšฝ Regular

    @sam said:

    I think that at this point its kind of unfair to expect @codinghorror not to be trolling you here

    Agreed. But it could be tempered by more helpfulness too, even Blakeyrat in persona does that.

    @sam said:

    heck not a day goes by without a new topic about "yet another stupid decision the Discourse team made, again" ... my method of dealing with it is simply ignoring

    I do get that it must be very hard to maintain a thick skin while people poke holes in your project/decisions. I do think that very little of it is meant to be hurtful, quite a lot is due to frustration (for whatever reason) and just speaking frankly.

    @sam said:

    The clown computing thing, though trolly is relevant, there is a trend of seeking salvation in the cloud, people are giving up on the art of custom building hardware to match a performance problem. The cloud perf numbers reflect that.

    Definitely agreed, the other part of the trend is to create lego leaning-towers out of as many frameworks as humanly possible. It's definitely RAD but I don't think it's a good direction.
    It causes a lot of unforeseen interactions between the layers.

    @sam said:

    we treat all the bug reports we get here very seriously and strongly appreciate the quality of bug reports and testing

    I still really think a proper bug tracker would be a massive benefit. And more automated testing to catch the regressions.


    Anyway, for my part I quite like most of Discourse after a long adjustment period. I found it weird the other day to have to F5 a normal forum to get the next posts and when the notifications stopped working I found I had been using them as navigation a lot.

  • Banned

    New numbers, post beta upgrade:

    Top 100 routes by Server Load
    
    Route                       Duration Reqs  Mobile       
    -----                       -------- ----  ------       
    topics/show                 23224.71 66338  2422 (3.65)% 
    user_avatars/show            3030.02 21639 2998 (13.85)% 
    user_avatars/show_letter     2201.52  5023  778 (15.49)% 
    topics/timings (POST)        1843.71 25260 4002 (15.84)% 
    topics/posts                 1301.32  3562  556 (15.61)% 
    users/show                   1158.59   619    13 (2.10)% 
    list/latest                  1048.41 15724   339 (2.16)% 
    session/csrf                  936.72 33685     2 (0.01)% 
    exceptions/not_found          750.14 24023   844 (3.51)% 
    posts/create (POST)           585.61   407    36 (8.85)% 
    notifications/index           275.41  2091    50 (2.39)% 
    post_actions/create (POST)    224.65   637  147 (23.08)% 
    topics/feed                   216.79  1287    88 (6.84)% 
    draft/update (POST)           215.76  3564   254 (7.13)% 
    site/settings                 161.05  6522     0 (0.00)% 
    posts/show                    146.34  2392  309 (12.92)% 
    - (POST)                      133.16   174    10 (5.75)% 
    posts/update                   86.69    84     3 (3.57)% 
    search/query                   79.12    59    8 (13.56)% 
    exceptions/not_found (POST)    55.89  1684     0 (0.00)% 
    composer_messages/index        54.20   558    45 (8.06)% 
    list/latest_feed               49.28   105     0 (0.00)% 
    list/category_latest           38.72   189   26 (13.76)% 
    clicks/track                   37.20   503    38 (7.55)% 
    post_actions/users             31.02   192   41 (21.35)% 
    site_customizations/show       27.82   697   87 (12.48)% 
    user_actions/index             20.94    54   15 (27.78)% 
    onebox/show                    19.92    52     0 (0.00)% 
    list/new                       18.50    76   22 (28.95)% 
    -                              18.08   411     5 (1.22)% 
    

    Points of comparison...

    topic/timings has gone WAY down both in relative number of requests AND duration. We were averaging over 200ms per each of these, it is down to 76ms.

    topics/show is at #1 as expected, which is a good thing

    avatars are still quite heavy and may need some work.

    Top 30 users by Server Load
    
    Username             Duration Reqs   Routes                                                                          
    --------             -------- ----   ------                                                                          
    
    [Anonymous]          26374.11 158931 topics/show(19838.98) user_avatars/show(1538.83) users/show(1053.81)             
                                         session/csrf(936.56) exceptions/not_found(749.82)                                
    
    
    PaulaBean             1861.99   6867 topics/show(1830.29) list/category_latest(19.26) topics/status(6.71)             
                                         posts/create (POST)(5.73)                                                        
    
    
    calmh                 1070.07   1584 user_avatars/show_letter(611.47) user_avatars/show(345.92) topics/timings        
                                         (POST)(51.42) topics/show(24.21) list/latest(19.77)                              
    
    
    RaceProUK              797.92   3103 topics/show(391.12) posts/create (POST)(113.74) topics/timings (POST)(112.24)    
                                         list/latest(45.75) draft/update (POST)(30.18)                                    
    
    
    todo                   430.33    967 topics/posts(390.97) notifications/index(22.05) topics/show(9.40) topics/timings  
                                         (POST)(4.05) exceptions/not_found (POST)(3.77)                                   
    
    
    boomzilla              390.08   2140 posts/create (POST)(90.45) topics/timings (POST)(78.61) topics/show(73.01)       
                                         draft/update (POST)(28.52) post_actions/create (POST)(25.47)                     
    
    
    CoyneTheDup            362.11   1039 user_avatars/show_letter(126.87) user_avatars/show(104.87) topics/timings        
                                         (POST)(43.60) posts/create (POST)(26.07) search/query(21.34)                     
    
    
    dse                    353.77     92 user_avatars/show_letter(239.92) user_avatars/show(112.62) topics/show(0.41)     
                                         topics/timings (POST)(0.37) list/latest(0.19)                                    
    
    
    NetBot                 351.10    681 topics/posts(293.78) notifications/index(27.96) post_actions/create              
                                         (POST)(22.21) exceptions/not_found (POST)(7.15)                                  
    
    
    Zoidberg               330.38    707 topics/posts(261.30) notifications/index(30.72) exceptions/not_found             
                                         (POST)(15.16) topics/show(11.84) post_actions/create (POST)(6.17)                
    
    
    TwelveBaud             312.28    608 user_avatars/show_letter(198.42) topics/timings (POST)(50.72)                    
                                         user_avatars/show(24.77) topics/show(15.38) topics/posts(5.21)                   
    
    
    cartman82              275.42   2091 topics/timings (POST)(59.73) topics/show(43.76) user_avatars/show(36.26)         
                                         user_avatars/show_letter(26.66) posts/create (POST)(23.47)                       
    
    
    abarker                269.05    594 user_avatars/show_letter(146.61) user_avatars/show(35.09) topics/timings         
                                         (POST)(32.67) topics/show(18.09) post_actions/create (POST)(10.79)               
    
    
    swayde                 248.44   1235 user_avatars/show(87.62) topics/timings (POST)(67.36) topics/show(21.45)         
                                         list/latest(17.89) posts/create (POST)(11.57)                                    
    
    
    PleegWat               247.79   1096 user_avatars/show(79.56) topics/show(70.29) topics/timings (POST)(52.68)         
                                         list/latest(15.66) posts/create (POST)(11.65)                                    
    
    
    loose                  234.02   1586 topics/timings (POST)(53.53) topics/show(46.24) user_avatars/show(44.29)         
                                         draft/update (POST)(26.79) posts/create (POST)(22.47)                            
    
    
    accalia                209.17   1207 topics/timings (POST)(74.20) topics/show(71.31) posts/create (POST)(19.13)       
                                         users/show(9.33) notifications/index(5.95)                                       
    
    
    ChaosTheEternal        181.26   1150 topics/show(63.42) topics/timings (POST)(48.61) user_avatars/show(47.14)         
                                         list/latest(8.54) post_actions/create (POST)(2.83)                               
    
    
    Rhywden                169.69   1345 topics/timings (POST)(52.60) posts/create (POST)(24.36) topics/show(22.44)       
                                         posts/update(16.46) list/latest(15.40)                                           
    
    
    blakeyrat              167.19    933 topics/show(49.06) topics/timings (POST)(48.88) posts/create (POST)(30.50)       
                                         posts/update(8.76) notifications/index(5.53)                                     
    
    
    JBert                  157.67   1495 topics/timings (POST)(43.64) topics/show(30.87) draft/update (POST)(17.81)       
                                         post_actions/create (POST)(13.89) user_avatars/show_letter(9.89)                 
    
    
    Buddy                  115.84   1172 topics/timings (POST)(40.42) posts/create (POST)(22.48) topics/show(13.06)       
                                         user_avatars/show(7.10) topics/posts(6.74)                                       
    
    
    Boner                  113.49    516 user_avatars/show(48.94) topics/show(19.57) topics/timings (POST)(13.86)         
                                         user_avatars/show_letter(7.50) users/show(5.84)                                  
    
    
    Yamikuronue            112.75    766 topics/timings (POST)(34.81) topics/show(23.12) user_avatars/show_letter(10.84)  
                                         uploads/create (POST)(9.35) draft/update (POST)(6.98)                            
    
    
    darkmatter             111.63    986 posts/create (POST)(25.11) topics/timings (POST)(21.74) topics/show(19.11)       
                                         user_avatars/show(10.87) post_actions/create (POST)(9.16)                        
    
    
    Luhmann                105.32    359 topics/timings (POST)(53.98) topics/show(22.08) user_avatars/show(8.62)          
                                         posts/create (POST)(6.37) topics/posts(6.01)                                     
    
    
    CreatedToDislikeThis   105.19    169 user_avatars/show(70.02) user_avatars/show_letter(14.58) topics/timings          
                                         (POST)(12.54) topics/show(5.41) list/latest(1.75)                                
    
    
    Maciejasjmj            104.22    664 topics/timings (POST)(28.67) users/show(22.64) topics/show(10.71) posts/create   
                                         (POST)(10.39) user_actions/index(7.49)                                           
    
    
    PJH                    101.30   1033 topics/timings (POST)(46.21) topics/show(35.99) posts/create (POST)(5.90)        
                                         topics/posts(4.72) user_avatars/show(1.86)                                       
    
    
    HardwareGeek            90.93    794 topics/show(18.84) topics/timings (POST)(18.40) user_avatars/show(16.38)         
                                         list/latest(13.34) post_actions/create (POST)(6.51)      
    

    @apapadimoulis @paulabean is still at #1, but I can see load has decreased.

    @calmh is # of real users, which is a bit unfair, this only happened cause he/she was browsing some old topics which triggered avatar caching,

    Rest of the stuff looks pretty normal, nothing too out of the ordinary

    I am fascinated at how high mobile content creation is, and here its even smaller than it is on BBS (which are at 10% mobile content creation)

    Overall the reports are should expected and reasonable perf.


  • FoxDev

    Weekends are usually a lot quieter; you'd be better off with weekday figures ;)


  • Banned

    NP, will run the report again in a couple of days


  • Banned

    Also... this goes out to everyone who is a slave to LINQ2SQL / Entity Framework and so on



  • @sam said:

    slave to LINQ2SQL / Entity Framework

    That's just the way those things work. It'd be fucking amazing if they were as good as sql all the time. Now we use use it because it's better (faster In programmer time) most of the time.


  • FoxDev

    ORMs are great at CRUD operations; the trick is not forgetting more complex operations are sometimes better written in pure SQL ๐Ÿ˜„



  • @sam said:

    New numbers, post beta upgrade:

    the numbers thread is :arrows:



  • @RaceProUK said:

    more complex operations are sometimes better written in pure SQL

    Write the whole page generation thing in SQL. Let the database server do the work. Oh, you render it clientside? No problem.



  • TIL ``#WhatDailyWtfUserLivesMatter



  • @RaceProUK said:

    complex operations are sometimes better written in pure SQL

    Unless you need to iterate.

    Or you want to use the results of a sproc.



  • @xaade said:

    WhatDailyWtf

    Is that supposed to say WTDWTF or WhatTheDailyWTF? Something is wrong with your camelCase.



  • Too many words...



  • @RaceProUK said:

    ORMs are great at CRUD operations; the trick is not forgetting more complex operations are sometimes better written in pure SQL

    Of course, it's even better when you have an ORM that can map objects to complex, user-defined queries ;) That way, you can have your cake and eat it too...



  • @tarunik said:

    complex, user-defined queries

    like a view?


  • FoxDev

    Looks like something was going on @sam; not sure what you can make of it. Times are BST (UTC+1)

  • I survived the hour long Uno hand

    In case anyone is interested, here's the results of my most recent likes binge. I've been saving up unliked postsextremely forgetful about t/1000 recently. The first section is the auto-like script set to five seconds. Section two is me manually liking as fast as I could move my mouse, concluding with two nice post badges that I "awarded". I got some "An error has occurred" popups that correspond roughly with the red spikes. Many server seconds died bringing us this information.


  • Was your like script javascript running from the console or in a bookmarklet? Or something more complex?


  • I survived the hour long Uno hand

    Bookmarklet. I killed it as soon as I started manual likes.


  • โ™ฟ (Parody)

    I think the upsurge coincided with actual posting in /t/1000. Which also results in a surge of Liking, of course.


  • I survived the hour long Uno hand

    That's good to know. Assuming that nobody else was doing anything around the border between the two sections there is still a noticeable difference between 5 seconds per like and 1-2 likes per second. <units...>



  • @Jarry said:

    like a view?

    Of course, you can often encapsulate such things in views, at least in theory. Whether it's useful in practice depends on your update needs...


  • Banned

    Will run reports tomorrow if I have a chance, kind of flooded on some ops work at the moment.

    In other news @boomzilla you have full page search on meta now.


  • โ™ฟ (Parody)

    ๐Ÿ˜


  • Banned

    Ran the report today ... but one thing that was YELLING out was

    ArchiveTeam ArchiveBot/20150617.01 (wpull 1.2.1) and not Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/5 37.36

    Was going NUTS, how nuts you ask

    IP Address      Duration Reqs 
    ----------      -------- ---- 
    ARCHIVE_BOT      9164.66 19342 
    IP               2423.38  7034 
    IP               2145.49  8928 
    IP               2020.69 11902 
    IP               1456.88 51239 
    IP               1374.96 19630 
    IP               1215.04  1386 
    

    Top users for the day:

    Username        Duration Reqs   Routes                                                                          
    --------        -------- ----   ------                                                                          
    
    [Anonymous]     25215.83 160686 topics/show(15307.96) user_avatars/show(2647.76)                                 
                                    user_avatars/show_letter(1590.01) session/csrf(1210.50) list/latest(1065.87)     
    
    
    PaulaBean        2145.49   8928 topics/show(2128.11) list/category_latest(15.22) topics/status(1.08)             
                                    posts/destroy(1.08)                                                              
    
    
    RaceProUK        1844.26   8413 topics/show(920.72) posts/show(254.80) topics/timings (POST)(190.09)             
                                    posts/create (POST)(113.78) list/latest(94.66)                                   
    
    
    dcon             1214.72   1378 post_actions/create (POST)(622.08) topics/timings (POST)(269.57)                 
                                    posts/show(211.22) topics/show(37.07) topics/posts(18.71)                        
    
    
    MathBot          1189.73   1697 post_actions/create (POST)(684.95) topics/posts(465.04)                          
                                    notifications/index(24.09) topics/show(8.87) exceptions/not_found (POST)(5.30)   
    
    
    accalia           994.47   5989 topics/posts(247.32) posts/show(196.69) topics/timings (POST)(136.24)            
                                    topics/show(109.23) posts/create (POST)(97.03)                                   
    
    
    Zoidberg          744.56   3961 topics/posts(404.26) posts/show(201.71) post_actions/create (POST)(96.44)        
                                    notifications/index(25.34) topics/show(9.02)                                     
    
    
    boomzilla         694.98   3064 topics/timings (POST)(171.44) topics/show(138.43) posts/create (POST)(100.18)    
                                    post_actions/create (POST)(90.97) draft/update (POST)(49.43)                     
    
    
    abarker           547.39   2581 topics/timings (POST)(133.17) topics/show(77.71) posts/create (POST)(69.06)      
                                    users/show(64.40) post_actions/create (POST)(49.54)                              
    
    
    ChaosTheEternal   485.38   2529 topics/show(102.81) topics/timings (POST)(97.62) posts/show(96.87)               
                                    post_actions/create (POST)(65.49) topics/posts(45.23)                            
    
    
    PJH               470.29   2771 topics/timings (POST)(160.34) topics/show(131.92) posts/create (POST)(30.00)     
                                    user_avatars/show_letter(20.98) topics/posts(18.22)                              
    
    
    locallunatic      461.31   2284 topics/timings (POST)(205.96) topics/show(80.77) post_actions/users(41.19)       
                                    post_actions/create (POST)(40.24) user_avatars/show_letter(20.16)                
    
    
    obeselymorbid     444.96    625 posts/show(273.75) post_actions/create (POST)(101.48) topics/timings             
                                    (POST)(37.98) topics/show(10.96) posts/by_number(5.75)                           
    
    
    xaos              427.76   2957 topics/timings (POST)(246.49) topics/posts(70.91) user_avatars/show(39.57)       
                                    user_avatars/show_letter(27.94) topics/show(21.43)                               
    
    
    OffByOne          394.16   2073 posts/show(222.75) topics/timings (POST)(61.96) post_actions/create              
                                    (POST)(43.72) topics/show(27.69) topics/posts(26.53)                             
    
    
    todo              389.83   1063 topics/posts(328.78) notifications/index(37.11) topics/show(9.90)                
                                    exceptions/not_found (POST)(9.21) posts/create (POST)(2.52)                      
    
    
    Jarry             372.26   1630 topics/timings (POST)(161.45) topics/show(74.13) post_actions/create             
                                    (POST)(56.23) posts/show(20.60) posts/create (POST)(17.22)                       
    
    
    darkmatter        365.55    523 post_actions/create (POST)(118.72) topics/timings (POST)(73.32)                  
                                    posts/show(61.70) posts/create (POST)(42.89) draft/update (POST)(27.35)          
    
    
    HardwareGeek      362.63   2223 topics/timings (POST)(93.61) post_actions/create (POST)(54.72)                   
                                    topics/show(53.30) user_actions/show(48.87) list/latest(24.42)                   
    
    
    sockbot           355.56   3566 posts/show(208.42) post_actions/create (POST)(93.24) notifications/index(45.31)  
                                    exceptions/not_found (POST)(8.59)                                                
    
    
    TwelveBaud        353.72   1544 user_avatars/show_letter(140.11) topics/timings (POST)(88.41) topics/show(48.90)  
                                    posts/create (POST)(23.03) posts/show(17.85)                                     
    
    
    PleegWat          333.24   2214 topics/timings (POST)(134.34) topics/show(121.02) list/latest(20.95)             
                                    posts/create (POST)(17.53) user_avatars/show(12.02)                              
    
    
    NetBot            328.61    742 topics/posts(254.34) notifications/index(34.91) post_actions/create              
                                    (POST)(29.80) exceptions/not_found (POST)(9.55)                                  
    
    
    aliceif           320.39   1166 user_avatars/show(119.91) user_avatars/show_letter(41.38) users/show(29.54)      
                                    topics/show(29.22) topics/timings (POST)(28.20)                                  
    
    
    eor               314.72    726 post_actions/create (POST)(246.41) posts/show(25.79) topics/timings              
                                    (POST)(18.00) topics/posts(15.45) topics/show(4.85)                              
    
    
    CHUDbert          308.76    726 posts/show(134.12) topics/timings (POST)(66.76) user_avatars/show_letter(32.10)  
                                    topics/show(22.52) user_avatars/show(19.33)                                      
    
    
    Maciejasjmj       300.10   2358 users/show(66.54) topics/timings (POST)(56.72) topics/show(43.26)                
                                    user_avatars/show_letter(24.07) posts/create (POST)(16.01)                       
    
    
    antiquarian       285.36   1462 topics/timings (POST)(129.15) topics/show(72.44) user_avatars/show_letter(24.06)  
                                    posts/create (POST)(13.52) list/latest(10.31)                                    
    
    
    Yamikuronue       282.82   1974 topics/timings (POST)(90.20) topics/show(75.87) posts/create (POST)(34.52)       
                                    post_actions/create (POST)(17.37) list/latest(14.97)                             
    
    
    FrostCat          276.69   1526 topics/timings (POST)(118.27) topics/show(70.34) posts/create (POST)(34.53)      
                                    list/latest(8.24) draft/update (POST)(6.38)                                 
    
    
    Route                       Duration Reqs  Mobile       
    -----                       -------- ----  ------       
    topics/show                 21124.25 50384  2338 (4.64)% 
    topics/timings (POST)        6166.21 65190  4919 (7.55)% 
    user_avatars/show            3599.19 29730 3552 (11.95)% 
    post_actions/create (POST)   3000.16  3537   206 (5.82)% 
    topics/posts                 2910.74  9352   721 (7.71)% 
    posts/show                   2727.11 24380   586 (2.40)% 
    user_avatars/show_letter     2444.59 11997   834 (6.95)% 
    list/latest                  1692.38 14171   297 (2.10)% 
    posts/create (POST)          1254.23   777    21 (2.70)% 
    session/csrf                 1210.79 37538     2 (0.01)% 
    users/show                   1119.87  2859    29 (1.01)% 
    exceptions/not_found          768.15 26357     4 (0.02)% 
    topics/feed                   608.65  4486     9 (0.20)% 
    draft/update (POST)           387.93  5306   144 (2.71)% 
    notifications/index           382.59  2785    33 (1.18)% 
    posts/update                  130.56   138     4 (2.90)% 
    composer_messages/index       111.98  1081    35 (3.24)% 
    list/category_latest          105.03   467    19 (4.07)% 
    site/settings                  97.83  3904     0 (0.00)% 
    post_actions/users             90.94   493    18 (3.65)% 
    search/query                   81.19   128     7 (5.47)% 
    posts/replies                  71.93   756     0 (0.00)% 
    clicks/track                   71.33  1080    30 (2.78)% 
    exceptions/not_found (POST)    69.55  1928     0 (0.00)% 
    about/index                    66.97    21     1 (4.76)% 
    site_customizations/show       65.03  1464   127 (8.67)% 
    - (POST)                       63.84   247    13 (5.26)% 
    list/unread                    57.23   357     8 (2.24)% 
    user_actions/show              56.80   358     8 (2.23)% 
    user_actions/index             53.10   204   41 (20.10)%
    

    Stuff is looking reasonable except for standard like binges and archive bot running amok


  • FoxDev

    @sam said:

    ArchiveTeam ArchiveBot/20150617.01 (wpull 1.2.1) and not Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.90 Safari/537.36

    that's not one of my user agents.....

    who is running that one i wonder?

    ArchiveBot is an IRC bot designed to automate the archival of smaller websites (e.g. up to a few hundred thousand URLs). You give it a URL to start at, and it grabs all content under that URL, records it in a WARC, and then uploads that WARC to ArchiveTeam servers for eventual injection into the Internet Archive (or other archive sites).

    ..... oookay....

    To use ArchiveBot, drop by #archivebot on EFNet. [snip] issue commands by typing it into the channel. Note you will need channel operator (@) or voice (+) permissions in order to issue archiving jobs;

    /me wanders off to the job list for that bot

    Job started on 6/18, has grown to almost 150GB and was crawling eve online wiki.... now it's in the dailymail.....

    that's a very badly behaved bot indeed!


  • FoxDev

    I'm tempted to suggest blacklisting ArchiveBot; the amount of load it's generating is insane



  • Even better would be to have a Discourse WARC generator. It's on the "eventually" wishlist.


  • FoxDev

    @RaceProUK said:

    I'm tempted to suggest blacklisting ArchiveBot;

    i thought i just did...?

    ๐Ÿ˜•


  • FoxDev

    It's 2:46AM ๐Ÿ˜›


  • FoxDev

    why are you still awake then?

    it's five ours earlier here and i'm not going to be able to last much longer anyway.


  • FoxDev

    @accalia said:

    why are you still awake then?

    Maybe I'm sleep-posting? ๐Ÿ˜†

    In all seriousness, I am in the process of going to bed



  • Here's why:

    <ivan`> I ignored the whole domain

  • Garbage Person

    Or. You know. You could increment it.

    [code]
    BEGIN TRANSACTION
    INSERT INTO LIKES (stuff)

    UPDATE Topics SET NumberOfLikes = NumberOfLikes+1

    COMMIT TRANSACTION
    [/code]

    Or put it on a trigger.

    Just don't do
    [code]
    BEGIN TRANSACTION
    INSERT INTO LIKES (stuff)

    UPDATE Topics SET NumberOfLikes = (SELECT COUNT(*) FROM LIKES WHERE TopicID = whatever)

    COMMIT TRANSACTION
    [/code]

    "I had 10 cookies. Mommy just gave me 1 more! How many cookies do I have now? 1-2-3-4-5-6-7-8-9-10-11! I have 11 cookies!"
    versus
    "I had 10 cookies. Mom gave me another. I have 11 cookies."

    If you really want to make sure you can't desync the count, either use a trigger on Like insert/delete/update. and/or recalculate the thing nightly.


  • :belt_onion:

    @accalia said:

    it's five ours earlier here

    five whats of yours earlier?



  • That's so obvious that if they're not doing it like that, there's an equally obvious reason why it would not work.


  • Banned

    STEP 1

    Don't run

    app/models/post_action.rb:418:in `update_counters'
    app/models/post_action.rb:280:in `act'
    app/controllers/post_actions_controller.rb:18:in `create'
    lib/middleware/anonymous_cache.rb:124:in `call'
    lib/middleware/request_tracker.rb:70:in `call'
    lib/scheduler/defer.rb:85:in `process_client'
    lib/middleware/unicorn_oobgc.rb:95:in `process_client'
    SELECT SUM("posts"."like_count") AS sum_id FROM "posts"  WHERE ("posts"."deleted_at" IS NULL) AND "posts"."topic_id" = 1000  
    

    Twice every time you like a post

    STEP 2

    Just do a +1 if you perform a like at the topic level, only resync counts on delete of a post.

    STEP 3

    profit



  • @sam said:

    only resync counts on delete of a post.

    So deleting a post is an expensive operation again? :trollface:


  • Banned

    Deleting already does that... the issue with liking is that so much of it happens



  • @cvi said:

    Trolling around here seems pretty ubiquitous, so why would it be any different if it's @codinghorror trolling?

    Because he kinda sucks at it?

    @RaceProUK said:

    I'm tempted to suggest blacklisting ArchiveBot; the amount of load it's generating is insane

    But... the place in history! Think about it!

    (seriously though, if our site one day blows up like the old forums, at least we'll have the archive to binge)



  • @Maciejasjmj said:

    (seriously though, if our site one day blows up like the old forums, at least we'll have the archive to binge)

    But if the ArchiveBot was not clogging up the works, there would be so much more history for it to archive!



  • Actually, on second thought...

    It's also been quite insane lately, with 10 snapshots running on June 18.


  • Banned

    Well one less counting



  • @sam said:

    Just do a +1 if you perform a like at the topic level, only resync counts on delete of a post.

    Hmm. Wonder what would happen if we synchronise ourselves a bit so that a large number of users like the same post at the same time?



  • @Maciejasjmj said:

    Because he kinda sucks at it?

    Fair enough. Haven't really bothered to compare trolling-abilities between different posters here. (Hey, at least when he posts an image macro, it's not the same damn image macro that he already posted here 2 million times, so that's a plus.)


  • Discourse touched me in a no-no place

    @RaceProUK said:

    I'm tempted to suggest blacklisting ArchiveBot; the amount of load it's generating is insane

    If it's that badly behaved then I suspect /robots.txt won't be looked at.

    Let's see...

    ROBOTS.TXT is a stupid, silly idea in the modern era. Archive Team entirely ignores it and with precisely one exception, everyone else should too.

    I think I'll be adding them to the blacklist, if they have a tight IP range that they search from...

    @Sam, is it possible to hook in BadBehavior somehow? I'm not sure if it blocks this bot, but I can have a word with the author...


  • FoxDev

    Regardless, Archive Team will ignore it and we'll delete your complaints

    That attitude sounds familiarโ€ฆ


  • FoxDev

    @PJH said:

    If it's that badly behaved then I suspect /robots.txt won't be looked at.

    likely

    @PJH said:

    >ROBOTS.TXT is a stupid, silly idea in the modern era. Archive Team entirely ignores it and with precisely one exception, everyone else should too.

    oh :facepalm: not only do they ignore it but they're proud of it!

    I say block them.

    /me goes off to construct the proper nginx rule to block their useragent for my sites.


Log in to reply