Jump to content

freghar

Members
  • Posts

    461
  • Joined

  • Last visited

    Never
  • Donations

    0.00 GBP 

Posts posted by freghar

  1. Well while it surely depends on HW capabilities, so a 60GHz (yes, 60) CPU and a few TBs of RAM could hold many thousands of players. Except that nobody can make a 60GHz CPU that doesn't burn itself several milliseconds after it's startup. That's where multiple cores come in, but AFAIK mangos isn't really well optimized to run on a multicore system. So yes, I'd imagine 4500 is possible, but with some sort of a multithread patch.

  2. Another way to improve mysql seems to use thread cached mallocs developped by google.

    Install and add "LD_PRELOAD="/usr/lib/libtcmalloc.so"" in your mysqld_safe (fully recompile mysql with this new malloc).

    http://google-perftools.googlecode.com/svn/trunk/doc/tcmalloc.html

    Well, first, it's a comparison against glibc 2.3 from 2002-2003, current glibc is 2.9 (2009-2010). Second - using LD_PRELOAD is not "compilation". It's just a dynamic linking.

    When you compile a "dynamic executable", you can't run it alone. When you double click it (or launch some other way), a special program called "loader" is launched (/lib/ld*.so). This loader loads things like libc (glibc), libdl, libcrypt and all the libraries the binary was "soft linked" with (by the compiler at compilation time) and does the actual linking at runtime.

    An example list (for mangos-worldd) follows:

    $ ldd /opt/mangos/bin/mangos-worldd
           linux-vdso.so.1 =>  (0x00007fff217ff000)
           libACE-5.6.6.so => /opt/mangos/lib/libACE-5.6.6.so (0x00007f10aaa8b000)
           libmysqlclient_r.so.16 => /usr/lib/libmysqlclient_r.so.16 (0x00007f10aa65f000)
           libz.so.1 => /usr/lib/libz.so.1 (0x00007f10aa447000)
           libssl.so.0.9.8 => /usr/lib/libssl.so.0.9.8 (0x00007f10aa1f2000)
           libcrypto.so.0.9.8 => /usr/lib/libcrypto.so.0.9.8 (0x00007f10a9e51000)
           libtbb.so.2 => /opt/mangos/lib/libtbb.so.2 (0x00007f10a9c2a000)
           libtbbmalloc.so.2 => /opt/mangos/lib/libtbbmalloc.so.2 (0x00007f10a9a14000)
           libmangosscript.so.0 => /opt/mangos/lib/libmangosscript.so.0 (0x00007f10a980c000)
           libpthread.so.0 => /lib/libpthread.so.0 (0x00007f10a95ef000)
           libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f10a92db000)
           libm.so.6 => /lib/libm.so.6 (0x00007f10a9059000)
           libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f10a8e42000)
           libc.so.6 => /lib/libc.so.6 (0x00007f10a8ae1000)
           libdl.so.2 => /lib/libdl.so.2 (0x00007f10a88dd000)
           librt.so.1 => /lib/librt.so.1 (0x00007f10a86d4000)
           libcrypt.so.1 => /lib/libcrypt.so.1 (0x00007f10a849d000)
           libnsl.so.1 => /lib/libnsl.so.1 (0x00007f10a8285000)
           /lib64/ld-linux-x86-64.so.2 (0x00007f10aae56000)
    

    So the trick with LD_PRELOAD is in adding another library to this list, making it override already defined functions. This way you can force any application to use a network proxy by changing it's network stack (google for proxychains), use chroot as normal user (google for fakechroot) and do many other things like using libtcmalloc, if it's really that faster and doesn't break your application.

  3. The problem with precompiled headers in GCC is either

    • * in the g++ itself (well, it's optimization), since almost nobody uses precompiled headers on *nix
      * in the mangos build system (hosed automake build system / messed up dependencies)
      * in the precompiled headers automake patch (I know, it's maybe the one made by me with performance gain like 5-7%)

    Another way to speed up build process is to avoid using superlarge .h files (Player.h, Unit.h, ...) and split those, along with the .cpp files itself, into many smaller parts, so other .cpp files can include only the parts they're interested in. This actually saves quite a lot of time (at least on a C project using gcc, but - in theory - all compilers should benefit).

  4. (openSUSE with dark Gilouche theme)

    I googled a bit and found http://img248.imageshack.us/img248/1940/eclipsedarkgilouchethem.png which seems to have white font on panels, but still a black font on light gray as "text" GTK2 class. Which means you probably have your "text" and "base" colors set to dark on light.

    My heavily customized theme looks like http://img829.imageshack.us/img829/8202/screenshot2010073110151.png (a bit large indeed, but this is a smaller 15.4" laptop with rather high resolution).

    Well I didn't wanted to waste your time with screenshots, but since you can't reproduce the issue, I'll do so.

    http://img39.imageshack.us/img39/1997/screenshot2010073110211.png -- Gmail - as mentioned - uses colorless input fields, making my firefox select system colors

    quick reply:

    http://img210.imageshack.us/img210/4351/screenshot2010073110220.png

    http://img836.imageshack.us/img836/8486/screenshot2010073110222.png

    search (applies also to advanced search page):

    http://img20.imageshack.us/img20/2550/screenshot2010073110230.png

    http://img834.imageshack.us/img834/2794/screenshot2010073110231.png

    classic "advanced" post view:

    http://img534.imageshack.us/img534/2082/screenshot2010073110235.png

    http://img641.imageshack.us/img641/766/screenshot2010073110241.png

    http://img707.imageshack.us/img707/4021/screenshot2010073110242.png

    the same thing applies to selection and combo boxes, like language selection on the bottom - or even advanced search selection fields

    http://img33.imageshack.us/img33/4048/screenshot2010073110473.png

    I guess that's enough screenshots - some elements like checkboxes are fine as they probably have no color / style specifications.

  5. Dear forum administration group (or just TheLuda), I'd like to point out a pretty annoying forum color issue.

    I use a dark GTK theme on my system, which means all GTK+/GTK2 apps are nicely colored to my needs. Even most websites work fine with their default look, but some tend to have several attributes defined and others undefined. Most doesn't care, because it looks okay on common MS Windows systems under default color scheme, but - for the sake of clean design - it should be taken care of.

    The problem is in default system font vs. white background in "post new reply" and other textareas. In which case I get my default system font (white) on white/semi-white background. One way is to simply set font to be black (explicitly) or do it like gmail - leave textareas unstyled, in which case I get black background and white text. Either way works for me.

    Thanks,

    freghar

  6. Upstart has nothing to do with Cron. AFAIK it's only Ubuntu's replacement of sysv startup mechanism, no daemon, nothing that can restart mangos.

    Anyway I don't really see the point in making things ugly. Why the hell has somebody EVER came with the idea to use cron as mangos restarter? It's totally ... ahem. Imagine it has to run every minute just to check if mangos is running or not, it has to match against some binary name in process list, in a rare case it could launch mangos 2 or more times!

    Much simplier solution is to use a wrapper script with infinite loop, similar to what others posted, not only it can restart your mangos immediately (and not after 1-60 seconds), it can easily even check for it's return value (if it's 0 or 1, ie. shutdown or error, then don't restart). Furthermore it's a lot cleaner, since it doesn't have to check every minute for running mangos and it's binary-name-safe, so if some other user starts "cat" masked as "mangos-worldd" 20 times, it won't ever confuse your restarter, because it doesn't care about processes, it doesn't need to retrieve process list from the kernel.

    Also it's worthless to make restarters for realmd as it (from my experience) never crashes.

    edit: I admit I haven't properlz read all those posts above. Last time I checked Upstart (some years ago) it was just a paralell startup script system. If it's daemon now (that can restart services upon crash), it's at least as good as cron (if it *just* checks processes periodically).

    The basic loop script can be easily used when you need to run multiple mangos+realmd pairs, you don't even have to rename them as each restarter takes care of it's one server.

    An example:

    #!/bin/sh
    while true
    do
       ./mangos-worldd
       [ $? < 2 ] && exit 1
       sleep 5
    done;
    

    This is a very simple and clean (doesn't waste any unnecessary resources) restarter that exits when you .server shutdown your server (instead of restarting it) and when some error occurs (ie. DBCs out of date), so it won't meaninglessly start and error down all the time.

    Save this script as restarter.sh in the directory where mangos-worldd is, make it executable (chmod +x restarter.sh) and fire up a screen session using this script, ie. "screen -d -m -S mangosd ./restarter.sh". That's all.

  7. If so, I disagree! I can run a fancy gui on a remote computer and not impact performance at all. :)

    Well that's not strict. I'm aware of ASM-only GUI which is a few KBs in size (it's in fact a mini OS) and is about 50 times faster than bash in linux. Furthermore, the performance hit made by xserver is rather low, so if you run, say, fluxbox on Xorg, the performance hit is going to be much lower compared to KDE/Gnome and their tons of services.

    ... and I personally find bash / zsh shell more user-friendly than most GUIs, so ... :)

    server && (user friendly || ~performance)

    Well that depends. C-like languages treat conditions as "if (true && true && true ...)" while bash does the opposite: "0 && 0 && 0 && ..." because 0 return value == no error. So it's really

    server && (user friendly || performance)

    C-wise

  8. I have never worked with erlang, but have done quite a few things in haskell. For that reason, I thought erlang is one of the 10000+ language forks and the first sentence in the first post sounded like "hey! this erlang looks cool, let's rewrite everything to erlang!". As some people have little-to-none brain processing power, such threads also appear and I thought this is just another of them.

    If you mean it seriously, please accept my apology, I don't know any person who often works with functional languages and it's interested in mangos development at the same time.

    I've never worked with CUDA on the programming level, but doesn't CUDA need newer nvidia card? Can it be emulated for systems with no graphic card (ie. servers)?

  9. That's cool, but IMO, people don't learn using patches... You guys need to see exactly what the code is doing so you can modify it to fit your needs, and so you can actually learn something (for those of you that could use some learning anyway :P )

    It's not about learning, unified diff/patch is much easier to "read" for *real* developers than "replace that by this". Furthermore, there's no learning involved in the latter one, people just spend more time applying it, but that's all. They mostly don't even understand what the code does.

  10. So I'm trying to do a force-reset of all titles on current characters on 2.4.3 with the following SQL:

    UPDATE `characters` SET `data`=CONCAT(CAST(SUBSTRING_INDEX(`data`, ' ', 924) AS CHAR), ' ', 0, ' ', CAST(SUBSTRING_INDEX(`data`, ' ', -587)AS CHAR));

    And it works, all the values change to "0" however when you then go into load the character you get "Player#xxx has broken data and cannot be loaded".

    Does anyone know why this is happening?

    If anyone wants to check the 2.4.3 values for this: http://udbwiki.webhop.net/index.php/Character_data.

    PLAYER__FIELD_KNOWN_TITLES is 924.

    Actually, I believe it's one byte off.

    I've written a small C prog for this long time ago and AFAIK it's value always worked with this SUBSTRING_INDEX thing.

    #include <stdio.h>
    #include "UpdateFields.h"
    
    #define TARGET PLAYER__FIELD_KNOWN_TITLES
    
    int main(void)
    {
           printf("%#lx (%lu)\\n", TARGET+1, TARGET+1);
    
           return 0;
    }
    

    (edit the TARGET to your needs + put 0.12 UpdateFields.h into the *current* directory)

    The key thing here is probably TARGET+1, which returns 925 for me, so try that one.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use