As a compensation for his services in making a sale of real estate under the provisions of this chapter by order of court for the purpose of partition, the sheriff shall receive a commission on the amount of sales not exceeding two percent on the first one thousand dollars, and one percent on all sums over that amount and under five thousand dollars, and one-half of one percent on all sums over that amount.