Good question, and it would depend on the retracted length, and no doubt some other geometric considerations, but you're aware of that.
McMaster-Carr has a selection of hydraulic cylinders including a 2"x5" model.
McMaster-Carr is the complete source for your plant with over 595,000 products. 98% of products ordered ship from stock and deliver same or next day.
www.mcmaster.com