1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Elasticsearch Server Impact Thread

Discussion in 'Enhanced Search Support' started by Slavik, Jan 18, 2012.

  1. Slavik

    Slavik XenForo Moderator Staff Member

    Right, so people are slowly working their way to Elasticsearch, and besides myself and Deebs we don't have many stats out there.

    So, the idea of this thread is to see the impact of the search on the server.

    To find out the file size on disk, navigate to your elasticsearch index directory (/var/elasticsearch if you followed the guide in this forum) and run "du -ach"

    Posts Indexed: ~1.2 million
    Size on Disk: 925M Total
    Min/Max Ram Allocated in config: 512mb/2048mb

    Posts Indexed: ~4 million
    Size of Disk: 2.9GB Total
    MinMax Ram Allocated in config: 4096mb/4096mb
  2. Deebs

    Deebs Well-Known Member


    My settings:

    bootstrap.mlockall: true
    index.store.type: mmapfs
    Min: 4g
    Max Open Files: 65500 (for the process running Java/ES)
  3. CyclingTribe

    CyclingTribe Well-Known Member

    Posts Indexed: ~1.7 million
    Size on Disk: ~2.1G
    Min/Max Ram Allocated: ~512mb/2048mb
  4. shawn

    shawn Well-Known Member

    Sounds like ElasticSearch indices are roughly twice as large as Sphinx, but still fairly small. How short is the ElasticSearch min word length? IIRC, it only has a handful of words it *doesn't* index... so the single letter queries may account for the bulk of the index difference.
  5. Slavik

    Slavik XenForo Moderator Staff Member

    No minimum length.
  6. anonymous

    anonymous Member

    Posts Indexed: ~1.5 million
    Size on Disk: 2.9GB
    MinMax Ram Allocated: 256mb/1024mb
  7. lazy llama

    lazy llama Well-Known Member

    I've got ES installed on my test system and to be honest, it's really struggling due to lack of memory.

    Posts Indexed: 9.3 million
    Size on Disk: 8.8GB
    MinMax RAM allocated: 768mb/1GB

    I don't think it's going to be realistic to run ES on our current live system until I can get a server with more RAM.
    Sphinx works fine on both the test system and the live system, but the SphinxSearch add-on doesn't handle the changes to search in 1.1.x so we're stuck at 1.0.4 until either the add-on gets updated, I learn enough to update it myself or we get enough extra RAM to support ES.

    Because ES needs XF 1.1.1, I can't easily go live with it as I can't then fall back to Sphinx if it doesn't work on our hardware.

    Probably the incentive we need to try to scrape together a server with more RAM.
  8. Deebs

    Deebs Well-Known Member

    What are the specs of your existing server? Can you run free -m and paste the results? (Live server that is :))
  9. lazy llama

    lazy llama Well-Known Member

    The server specs are :
    CPU: Intel Quad Core Q9300 @ 2.50GHz
    RAM: 4GB
    OS: FreeBSD 7.2
    Disks: Adaptec-controlled RAID1 pair of 150GB WD Raptor SATA drives

    We don't do "free" on FreeBSD :)

    From a "top -d1"
    Mem: 2253M Active, 717M Inact, 758M Wired, 56M Cache, 418M Buf, 153M Free

    So running pretty tight. I could drop the memory and buffers that MySQL has access to but that's not going to help general performance.
    (We're an example of how well XenForo works on very limited hardware - see my sig for more info)
    GeeksChat likes this.
  10. Deebs

    Deebs Well-Known Member

    Sorry didn't realise you were on FreeBSD. When you say it is struggling what symptons are you seeing? Even on my setup with 4gb allocated I have to warm the ES cache.
  11. lazy llama

    lazy llama Well-Known Member

    Searches taking 6 or 7 seconds to come back (though the page shows Timing: 0.1687 seconds).
    Much faster once cached, obviously.

    It does seem to have settled down a bit since I bumped up the ES_MIN_MEM to 768mb, as before that I was getting "search failed, try again later"
  12. Mike

    Mike XenForo Developer Staff Member

    Failed searches should be logged, so if you can have a look at your server error log in the admin CP, that'd be helpful.
  13. Deebs

    Deebs Well-Known Member

    I would also activate the slowlog feature of ES to gain a better understanding of what is happening. Out of interest, standard ES install? 1 replica and 5 shards? and default settings in elasticsearch.yml?
  14. Deebs

    Deebs Well-Known Member

    Finally run the following:
    and look for field_evictions/filter_evictions. If they are greater than zero then you are memory constrained. For comparison here is my output:

  15. lazy llama

    lazy llama Well-Known Member

    When I looked earlier they were along the lines of "elastic search seems have gone away". On my phone now so tricky to check.
    Yeah, pretty much a standard install. I didn't change any shard or replica numbers. Just changed the min/max memory env. variables
    (Test system is Ubuntu for various reasons).

    I'll be trying some more tweaking and tuning when I get some spare time.

    It's not a massive issue really as we've been pushing things at the edge for a while, and it might be feasible yet.
  16. Anthony Parsons

    Anthony Parsons Well-Known Member

    Running for around 12hrs, you can see in the following images the slight increase in server processes, memory obviously, though server load only peaked initially during setup and cacheing, lots of playing around with it and settling in, though has now tapered off to normal load again.

    Screen shot 2012-01-21 at 7.49.26 AM.png
    Screen shot 2012-01-21 at 7.51.00 AM.png
  17. Deebs

    Deebs Well-Known Member

    Great stuff Anthony. How have your users noticed the change?
  18. DeltaHF

    DeltaHF Well-Known Member

    Thanks for sharing those graphs, Anthony! Are they generated by NewRelic?
  19. Anthony Parsons

    Anthony Parsons Well-Known Member

    They aren't really web savvy I guess... more general users, though I certainly have no doubt they will enjoy being able to now search for 3 letter words and such... which was one thing that used to annoy me deeply with MySQL... even though I could have changed the default settings, I didn't want to make my DB search table any bigger by that move.

    Hopefully they will provide feedback over time... though I am extremely impressed with the search functionality already.

    No idea to be perfectly honest... Wiredtree server graphs. I did read "proprietary client portal," so not sure if that means made for them or not.
  20. lazy llama

    lazy llama Well-Known Member

    Bit of an update. We managed to get another 4GB RAM for the server taking it to 8GB.
    As a result I upgraded our live system to XF 1.1.1 and installed XFES.

    So far it's been running nicely, as far as I can tell. Have a min/max of 1G/3G for the time being.

    The ES index is 8.8GB which is slightly more than twice the size of the Sphinx index.

    I'll need to read up a bit more on the ES options but so far it seems great.
    GeeksChat and Anthony Parsons like this.

Share This Page