The optimal slider bearing profile for maximum bearing load is studied by using direct constrained optimal control techniques. The constraints include the Reynolds and the energy equations. The energy equation takes into account the shear strain rate in the lubricant. The dependence of lubricant viscosity on temperature is considered. Technological constraints such as the maximum lubricant pressure and temperature and the minimum lubricant film thickness are included into the model. The realistic problem considered here yields optimal bearing profiles which are much more complex than the classical Rayleigh step bearing profile. The optimal bearing profile consists of an alternation of regions of constant height and more or less abrupt height variations. The number of constant height regions depends on the type of the constraint and in many cases is larger than three. The minimum value of the bearing height is one of the most important constraints. Four levels of model approximations have been tested. The most important model improvement is to take into account the temperature dependence of the lubricant viscosity. Several bearing design and operation parameters, such as bearing length, inlet height, sliding velocity and lubricant inlet pressure and temperature, have been considered. They all have complex influence on the optimal bearing profile.