add per_page for server middleware, paginate wating queue