Trying to determine the correct number of XFS allocation groups for postgresql server on Linux

114

What is the partition size in gigabytes? I usually divide that by 4 in order to determine the number of XFS allocation groups. I've run into situations where I only had one allocation group, and had problems with repair with an error indicating that there wasn't another AG to refer to in the file repair process. Either way, I think the general rule is partition size/4. There's some level of parallelism when running I/O against multiple allocation groups. But I'm assuming there's diminishing return on that number, so anywhere between partitionsize/2 and partitionsize/4 is reasonable.

So for a 200GB partition named "partitionname" on /dev/sdb1, I'd probably use the following mkfs.xfs command sequence.

mkfs.xfs -f -L /partitionname -d agcount=50 -l size=128m,version=2 /dev/sdb1

Also see: http://en.wikipedia.org/wiki/XFS#Allocation_groups

and http://everything2.com/index.pl?node_id=1479435 where it is noted:

At least one allocation group is needed per 4 gigs of space...
Share:
114

Related videos on Youtube

user1483208
Author by

user1483208

Updated on September 17, 2022

Comments

  • user1483208
    user1483208 over 1 year

    I have problem with dealing with invitations. Scenario: 1. Friend invites me to his game 2. I join to the game via push notification 3. onSignInSucceeded() in MenuActivity runs my main game activity

    @Override
    public void onSignInSucceeded() {
        Games.Invitations.registerInvitationListener(getApiClient(), this);
    
    
        if (getInvitationId() != null) {
            Intent intent = new Intent(getApplicationContext(), FindRoomActivity.class);
            intent.putExtra(BundleConstants.FRIEND_GAME_CLIENT, true);
            intent.putExtra(BundleConstants.INVITATION_ID, getInvitationId());
            startActivity(intent);
        }
    }
    

    4. Friend leaves the game before it ends, on my screen popup shows up and after confirmation I'm back in my Menuactivity, and again runs code form onSignInSucceeded and once again getInvitationId() returns invitation to the same (canceled) game.

    I was trying to run declineRoomInvitation or dismissRoomInvitation before I leave that canceled game, but nothing helps.

    • Ogen
      Ogen about 10 years
      How exactly "leaving" the game. Are you just ending the activity or something?
    • user1483208
      user1483208 about 10 years
      @Clay - I use Games.RealTimeMultiplayer.leave(getApiClient(), this, mRoom.getRoomId());
    • user1483208
      user1483208 about 10 years
      He leaves game 3 seconds after start ;-)
    • Ogen
      Ogen about 10 years
      See this is weird for realtime multiplayer. I have made a turnbased multiplayer and it's easy to detect when some one leaves a match becuase you get a call to onTurnBasedMatchReceived. I'm looking for something similar for realtime multiplayer...
    • iSee
      iSee almost 10 years
      From the XFS FAQ: I want to tune my XFS filesystems for something: "The standard answer you will get to this question is this: use the defaults".
  • Takah
    Takah over 13 years
    Thanks for the response. I have one 500GB partition and one 4TB partition. When you are saying the general rule is partition size/4 can I ask where you found this info? I have been googling all day and not been able to find anything this clear.
  • ewwhite
    ewwhite over 13 years
    See my edits above.
  • Takah
    Takah over 13 years
    Thanks again for the follow up. I think the second reference may be outdated now though. The newer mkfs.xfs man pages (linux.die.net/man/8/mkfs.xfs) say an AG can go up to 1TB now unless I am misunderstanding something.
  • ewwhite
    ewwhite over 13 years
    I've been diving by four for 6 years or so in XFS deployments. It's a reasonable rule. If in doubt, test with different settings. But there are other places to tune your XFS mounts; noatime, nobarrier, log sizes, etc.
  • user1483208
    user1483208 about 10 years
    There is method onPeerLeft(Room room, List<String> strings) so there is no need to send msg when someone left, onPeerLeft would notify you, but you answer helped, after start new activity I'll set invitation to null and see what will happen :)