With the number of e-Business applications dramatically increasing, a service level agreement (SLA) will play an important part in Web services. The SLA is a combination of several quality of services (QoS), such as security, performance, and availability, agreed between a customer and a service provider. Most existing research addresses only one of these QoS metrics. Furthermore, in the case of the response time defined as one of QoS metrics for performance, only the average time to process and complete a job is typically used. Moreover, customer requests often need to be distinguished, with different request characteristics and customer's different service requirements.In this paper, we consider a set of computer resources used by a service broker to host enterprise applications for two classes of differentiated customer services subject to a service level agreement. We study three QoS metrics, namely, trustworthiness, a percentile response time, and availability. The percentile response time metric defines a value below which the end-to-end response time has to be for a given percent of time. We present an approach for resource optimization in such an environment that minimizes the total cost of computer resources while satisfying all these three QoS metrics in a trust-based resource provisioning problem which typically arises in Web services. We formulate the trust-based resource provisioning problem as an optimization problem under SLA constraints, and then solve it using an efficient numerical procedure.