G T ] 1 9 Ju l 2 01 9 Online Revenue Maximization for Server Pricing

Efficient and truthful mechanisms to price resources on remote servers/machines has been the subject of much work in recent years due to the importance of the cloud market. This paper considers revenue maximization in the online stochastic setting with non-preemptive jobs and a unit capacity server. One agent/job arrives at every time step, with parameters drawn from an underlying unknown distribution. We design a posted-price mechanism which can be efficiently computed, and is revenue-optimal in expectation and in retrospect, up to additive error. The prices are posted prior to learning the agent’s type, and the computed pricing scheme is deterministic, depending only on the length of the allotted time interval and on the earliest time the server is available. If the distribution of agent’s type is only learned from observing the jobs that are executed, we prove that a polynomial number of samples is sufficient to obtain a near-optimal truthful pricing strategy.


Introduction
Designing mechanisms for a desired outcome with strategic and selfish agents is an extensively studied problem in economics, with classic work by Myerson [30], and Vickrey-Clarke-Groves [37], for truthful mechanisms. The advent of online interaction and e-commerce has added an efficiency constraint on the mechanisms, going so far as to prioritize computational efficiency over classical objectives: e.g., choosing simple approximate mechanisms when optimal mechanisms are computationally difficult, or impossible. Beginning with Nisan and Ronen [31], the theoretical computer science community has contributed greatly to the field, in both fundamental problems and specific applications. These include designing truthful mechanisms for the maximization of welfare and revenue, and has also focused on learning distributions of agent types, menu complexity, and dynamic mechanisms (e.g., [10,13]).
We consider this question in the setting of selling computational resources on remote servers or machines (cf. [2,36]). This is arguably one of the fastest growing markets on the Internet. The goods (resources) are assigned non-preemptively and thus have strong complementarities. Furthermore, since the supply (server capacity) is limited, any mechanism trades immediate revenue for future supply. Finally, mechanisms must be incentivecompatible, as non-truthful, strategic, behaviour from the agents can skew the performance of a mechanism from its theoretical guarantees. This leads us to the following question: Can we design an efficient, truthful, and revenue-maximizing mechanism to sell timeslots non-preemptively on a single server ? We design a posted-price mechanism which maximizes the expected revenue up to additive error, for agents/buyers arriving online, with parameters of value, length and maximum delay drawn from the underlying distribution. Three key aspects distinguish our problem from standard online scheduling: 1. In our setting, as time progresses, the server clears up, allowing longer jobs to be scheduled in the future if no smaller jobs are scheduled until then. 2. Scheduling the jobs is not exclusively to the discretion of the mechanism designer, but must also be desired by the job itself, while also producing sufficient revenue. 3. As the mechanism designer, we do not have access to job parameters in an incentivecompatible way before deciding on a posted price menu.
These three features lie at the core of the difficulty of our problem. Our focus will be on devising online mechanisms in the Bayesian setting. In our online model, time on the server is discrete. At every time step, an agent arrives at the server with a value V, length requirement L, and maximum delay D. These parameters are drawn from a common distribution, i.i.d. across jobs. The job wishes to be scheduled for at least L consecutive time slots, no more than D time units after its arrival, and wishes to pay no more than V. Jobs are assumed to be rational agents having quasi-linear utility in money, therefore they prefer the least-price interval within their constraints. The mechanism designer never learns the parameters of the job. Instead, she posts a price menu of (length, price) pairs, and the minimum available delay s. The job accepts to be scheduled as long as D ≥ s , and there is some (length, price) pair in the menu of length at least L and price at most V. We note that the pricing scheme can be dynamic, changing through time. If, at time epoch t, an agent chooses option ( , ) , then she pays and her job will be allocated to the interval [t + s, t + s + ] . She will choose the option which minimizes 1. We model the problem of finding a revenue maximizing pricing strategy as a Markov Decision Process (MDP). Given a price menu (length, price) and a state (minimum available delay) s at time t, the probability of transition to any other state at time t + 1 is obtained from the distribution of the job's parameters. The revenue maximizing pricing strategy can be efficiently computed via backwards induction. We also present an approximation scheme in the case where V is a continuous random variable. 2. We prove that the optimal pricing strategy is monotone in length under a distributional assumption, which we show is satisfied when the jobs' valuation follows a log-concave distribution, parametrized by length. Recall that log-concave distributions are exactly those which have a monotone hazard rate. This implies the existence of an optimal pricing mechanism which ensures truthfulness in the finite horizon setting when the distributions are known. This is extended to the infinite discounted horizon setting, incurring a small additive error. We also demonstrate good concentration bounds of the revenue obtained by the optimal truthful posted price strategy. 3. We finally investigate the robustness of the pricing strategy. We first show that a near optimal solution is still obtained when the distribution is known with a certain degree of uncertainty. We complement this result by analyzing the performances of the proposed pricing strategy when the distribution is only known from samples collected through the observations of the agents' decisions. We provide a truthful posted price -approximate mechanism if the number of samples is polynomial in 1∕ and the size of the support of the distribution.

Related work
A good starting point for a review of the revenue maximization in the cloud market literature is given by the paper of Kash and Key [21]. It offers a thorough discussion of the challenges and different dimensions of complexity of the problem, with pointers to the related literature. For comparison, our model falls within their unidimensional offering framework, since each job is only interested in getting allocated in its entirety paying a price as low as possible.
Probably the work closest to ours is Kash et al. [22]. There the authors studied the steady state of a stochastic process in which i.i.d. jobs arrive at discrete time steps, each job is characterized by a length and a value-per-unit that are drawn independently from two known distributions. The main result of the paper is the design of a price-per-unit scheme that approximates within a multiplicative factor of 2 the revenue (or the welfare) extracted by the best price menu. This work has three main differences from ours: first, their focus is on the simple vs optimal side of the problem (i.e., fixed price-per-unit vs optimal price menus), second we consider the additional constraint given by the deadlines and finally in our model the jobs are drawn from a possibly correlated distribution (a feature which increases the complexity of the pricing problem). Kash et al. [22] also showed how to generalize their results for multiple servers, this is also an interesting direction for further work in our model.
Another line of work studies the game-theoretical problem of adopting pricing strategies when multiple server providers (or different services within the same provider) compete for the jobs. Dierks and Seuken [11] investigated the interplay between two types of services offered by server providers; i.e., the main market where computing time is sold at a fixed price and the spot market where the resources left unused by the main market are priced dynamically. The same authors studied in [12] the competition between fixed price-per-unit strategies with respect to type-dependent ones, characterizing the Bayesian Nash Equilibria of a market where different server providers use the two strategies. Kash et al. [23] considered the problem faced by a server provider that is willing to periodically adopt new technologies and has to devise a pricing strategy that takes into consideration the switching cost of its clients from the old contract to the new ones.
We also mention two more applied papers: Kilcioglu et al. [24] addressed the problem of computing a price menu for revenue maximization with different machines and offered extensive numerical experiments. Babaioff et al. [2] proposed a system architecture for scheduling and pricing in cloud computing.
Revenue maximization is not the only objective considered in a mechanism design perspective of the cloud pricing problem. Azar et al. [1] provided a mechanism for preemptive scheduling with deadlines maximizing the total value of completed jobs (i.e., welfare). Chawla et al. [8] studied "time-of-use" pricing mechanisms, to match demand to supply with deadlines and online arrivals. They assume large-capacity servers, while seeking to maximize welfare in a setting in which the jobs arriving over time are not i.i.d.
Another possible objective for the design of incentive-compatible scheduling mechanisms is the total value of completed jobs, which have release times and deadlines. Porter [32] solved this problem in an online setting, while Carroll et al. [6] did the same in the offline setting for parallel machines, and Ströle et al. [35] in the online competitive setting with uncertain supply. Jain et al. [20] focused on social welfare maximization for nonpreemptive scheduling on multiple servers and obtained a constant competitive ratio as the number of servers increases.
Note that revenue maximization is arguably a harder objective than welfare or total allocated time. As an example, consider a simplified instance where the jobs have all unitary length and the mechanism has to learn the underlying distribution by posting prices (as we do in Sect. 4.2); the welfare maximizing strategy ignores the learning problem and always accepts the arriving job, e.g., setting the price to 0, while a revenue maximizing mechanism would need to identify Myerson's reserve value. Although our focus is on a different objective, we nevertheless share many modelling assumptions with the welfare maximization papers: we also consider posted prices, stochastic jobs and assume each job to be characterized by length, value, arrival time and internal deadline.
Posted price mechanisms (PPM) have been introduced by Sandholm et al. [34] and have gained attention due to their simplicity, robustness to collusion, and their ease of implementation in practice. One of the first theoretical results concerning PPM's is an asymptotic comparison to classical single-parameter mechanisms by Blumrosen et al. [5]. They were later studied by Chawla et al. [9] for the objective of revenue maximization, and further strengthened by Kleinberg et al. [25] and Dütting et al. [15]. Feldman et al. [16] showed that sequential PPM's can 1 2 -approximate social welfare for XOS valuation functions, if the price for an item is equal to the expected contribution of the item to the social welfare. Recently, Dütting et al. showed how simple PPMs outperform the best known complex mechanisms in double auctions [14].
The intrinsic truthfulness of posted price mechanisms and the specific structure of the feedback received by the mechanism (i.e., the trade happens or not given the posted prices) have been investigated extensively in the online learning community, starting from the seminal work of Kleinberg and Leighton [26]. We refer the interested reader to the survey by den Boer [13] and the more recent paper by Cesa-Bianchi et al. [7] for additional related work. Notice that this type of feedback problems are similar to the ones we encounter in our problem: posting a price menu and observing that a job of length gets scheduled for price p let us infer that the value of the sampled job is larger than p, but does not tell us its exact value.
The systematic study of sample complexity of revenue maximizing auctions has been initiated in the seminal work of Morgenstern and Roughgarden [28]. In a follow-up paper from the same authors, simple auctions have also been analyzed [29]. Sample complexity for revenue maximization has recently been studied by Cole et al. [10] showing that polynomially many samples suffice to obtain near optimal Bayesian auction mechanisms. A generalization to multidimensional auctions has recently appeared in [18]; we also mention [19] that exhibits tight bounds on the sample complexity of many problems related to mechanism design.

Structure of the paper
In Sect. 2 we describe the problem as a Markov Decision Process. In Sect. 3 we present an efficient algorithm for computing optimal policies for the finite time horizon given full knowledge of the distribution of the jobs' parameters. This is then extended to other settings in Sects. 3.3 and 3.4.
In Sect. 3.5, we demonstrate that the optimal policy is monotone and in Sect. 3.6 we describe the concentration bounds on the revenue of a pricing policy. Sections 4.1 and 4.2 give the learning algorithm and error bounds for computing the pricing policies with only (partial) sample access to the job distribution.
Finally, Sects. 4.3 and 5 are devoted to describing and summarizing the achieved results and future directions of research.

Model
Notation In what follows, the variables t, or L, v or V, and d or D are reserved for describing the parameters of a job that wishes to be scheduled. Respectively, they represent the arrival time t, required length , value v, and maximum allowed delay d. The lowercase variables represent fixed values, whereas the uppercase represent random variables. Scriptuppercase letters L, V, D represent the supports of the distributions on L, V, and D, respectively; and the bold-uppercase letters , , represent the maximum values in these respective sets. Finally, is reserved for pricing policy, whereas p is reserved for probabilities.
Single-machine, non-preemptive, job scheduling A sequence of random jobs wish to be scheduled on a server non-preemptively, for a sufficiently low price, within a time constraint. Formally, at every time step t, a single job with parameters (L, V, D) is drawn from an underlying distribution Q over the space L × V × D . It wishes to be scheduled for a price ≤ V in an interval [a, b] such that a − t ≤ D and b − a ≥ L.
Price menus Our goal is to design a take-it-or-leave-it, posted-price mechanism which maximizes the expected revenue. At each time period, the mechanism posts a "price menu" that specifies prices (i.e., one for each one of the possible lengths of the next job) and an earliest-available-time s t , indicating that times t through t + s t − 1 have already been scheduled ( s t will henceforth be referred to as the state of the server). We let S ∶= {0, … , + } to be the set of all possible states. The state of the server at a given time t is naturally a random variable which depends on the earlier jobs and on the adopted policy . As before, we will denote with s or s t the fixed value, and with S or S t the corresponding random variable. The price menu will be given by , a function of the current time, the state of the server and the length of the job arriving. So if we are at time t and the server is in state s t , then the prices are set according to t (s t , ⋅) ∶ L → ℝ. The reported pair ( t (s t , ⋅), s t ) is computed by the scheduler's strategy, which we determine in this paper. Once this is posted, a job (L, V, D) is then sampled i.i.d. from the underlying distribution Q.
If V ≥ t (s t , ) for some ≥ L , and D ≥ s t , then the job accepts the schedule, and reports the length ≥ L which minimizes price. Otherwise, the job reports = 0 and is not scheduled. To guarantee truthfulness, it suffices to have t (s, ⋅) monotonically non-decreasing for every state s: the agent would not want a longer interval since it costs more, and would not want one of the shorter intervals since they cannot run the job. It should be clear that the mechanism's strategy is to always report monotone nondecreasing prices, as a decrease in the price menu will only cause more utilization of the server, without accruing more revenue. The main technical challenge in this paper, then, is to show that under some assumptions, the optimal strategy is monotone nondecreasing, and efficiently computable.
Revenue objective Revenue can be measured in either a finite or an infinite discounted horizon. In the finite case, only T time periods occur and we seek to maximize the expected sum of revenue over these periods. Recall that the job parameters are drawn independently at random from the underlying distribution, so the scheduler can only base the "price menu" on the state of the system and the current time. Thus, the only realistic strategy is to fix a state-andtime-dependent pricing policy , X 3 , … } be the random sequence of jobs arriving, sampled i.i.d. from the underlying distribution. Let ∶ [T] × S × L → ℝ be the pricing policy. We denote as t (X, ) the revenue earned at time t with policy and sequence X . If X t does not buy, then t (X, ) = 0 , and otherwise, it is equal to t (s t , L t ) . We denote as T the total (cumulative) revenue earned over the T periods. Thus, The expected-future-revenue, given a current time and server state, is denoted with: The subscript of the expectation X ≥t denotes that we consider only jobs arriving from time t onward. Our objective is to find the pricing policy which maximizes U 0 (s = 0) . Call this * , and denote the expected revenue under * as U * t (⋅). In the infinite horizon setting, the future revenue is discounted at an exponentially decaying rate. Formally, revenue at time t is worth a t fraction of revenue at time 0, for some fixed < 1 . More precisely, we seek to maximize the -discounted future revenue, 3 Bayes-optimal strategies for sever pricing In this section, we seek to compute an optimal monotone pricing policy ∶ [T] × S × L → ℝ which maximizes revenue in expectation over T jobs sampled i.i.d. from an underlying known distribution Q. We also extend this result in two directions: in the infinite-horizon discounted case in Sect. 3.3 and for jobs whose value is distributed continuously in Sect. 3.4.
We first model the problem of maximizing the revenue in online server pricing as a Markov Decision Process that admits an efficiently computable, optimal pricing strategy. The main contribution of this section is to show that, for a natural assumption on the distribution Q, the optimal policy is monotone. We recall that this allows us to derive truthful Bayes-optimal mechanisms.

Markov Decision Processes
The theory of Markov Decision Processes is well suited to model our problem. A Markov Decision Process is, in its essence, a Markov Chain whose transition probabilities depend on the action chosen at each state, and where to each transition is assigned a reward. A policy is then a function mapping states to actions. In our setting, the states of the system are the ones outlined in Sect. 2 (i.e., the possible delays before the earliest available time on the server), and the actions are the "price menus." At every state s, a job arrives, and according to its random features and the prices offered, is scheduled. The next state is either max{s − 1, 0} , if the job does not choose to be scheduled (since we have moved forward in time), or s + − 1 , if a job of length is scheduled, since we have occupied more units. The transition probabilities depend on the distribution of job lengths, and the probability that a job accepts to be scheduled given the pricing policy (action). Formally, (Transitions to state " −1 " should be read as transitions to state " 0".) Note that a job of length may choose to purchase an interval of length greater than , which would render these transition probabilities incorrect. However, this may only happen if the larger interval is more affordable. It is therefore in the scheduler's interest to guarantee that t (s, ⋅) in monotone non-decreasing in , which incentivizes truthfulness, since this increases the amount of server-time available, without affecting revenue. Thus we restrict ourselves to this case.
It remains to define the transition rewards that correspond to the revenue earned. Formally, a transition from state s t to s t + − 1 incurs a reward of t (s, ) , whereas a transition from state s t to s t − 1 incurs no reward. We wish to compute a policy in such a way as to maximize the expected cumulative revenue, given as the (possibly discounted) sum of all transition rewards in expectation.

Example 1
Consider the following situation, where the server is in state s t = 1 and the job distribution is as follows: The following price menu is then posted: length 2 jobs cost 3, while unitary length jobs have cost 1. If the job arriving is (1, 1, 3), then the state of the server at time t + 1 is still 1 (one job completed, one job of length 1 scheduled) and the revenue extracted corresponds to the first entry of the price menu, i.e., 1. In the second case, if the job has parameters (2,4,3), then the server transitions to state 2, since the length 2 job is accepted at a price of 3. In the last case, the price requested by the server is too large, the job does not get allocated and the system goes to state 0 without earning any money.

Solving for the optimal policy with distributional knowledge
In this section, we present a modified MDP whose optimal policies can be efficiently computed, and show that these policies are optimal for the original MDP. For now, we assume that the mechanism designer is given access to the underlying distribution Q while, in the following sections, we show how it is possible to learn from sample enough information on Q to design a good strategy.
Since the problem has been modelled as a Markov Decision Process (MDP), we may rely on the wealth of literature available on MDP solutions, in particular, we can leverage the backwards induction algorithm (BIA) defined in Section 4.5 of the book by Putterman [33], included as Algorithm 1. However, we still need to ensure that this standard algorithm (1) runs efficiently, and (2) returns a monotone pricing policy.
Apart from the theoretical machinery of MDP and BIA, the key feature is that past prices do not contribute to future revenue insofar as the current state remains unchanged. Thus, to compute optimal current prices, we need only know the current state and expected future revenue. The idea is then to compute the optimal time-dependent policy and the incurred expected reward, for shorter horizons, then use this to recursively compute the optimal policies for longer horizons.
The total runtime of the BIA is O(T|S||A|) , where S and A denote the action and state spaces, respectively. Note that the dependence on T is unavoidable, since any optimal policy must be time-dependent. Recall that and denote the maximum values that L and D can take, respectively, and V is the set of possible values that V can take. Denote ∶= max{ + , |V|} . If we define the action space naïvely, we have |S| = + ≤ , and |A| ≤ . Thus, a naïve definition of the MDP bounds the runtime at O( ) , which is far from efficient. Requiring monotonocity only affects lower-order terms.
Modified MDP To avoid this exponential dependence, we can be a little more clever about the definition of the state space: instead of states being the possible server states, we define our state space as possible (state, length) pairs. Thus, when the MDP is in state (s, ) , the server is in state s, and a job of length has been sampled from the distribution. Our action space then is simply the possible values of t (s, ) , and the transition probabilities and rewards become: So, we get |S| = ( + ) ⋅ ≤ 2 , |A| ≤ and therefore the runtime of the algorithm becomes O(T 3 ) . A full description of the procedure is given in Algorithm 2.
It remains to prove that it is correct. We begin by claiming that these two MDPs are equivalent in the following sense:

Lemma 1 For any fixed pricing policy
where the U t (⋅) 's are as in (2), and the u t (⋅, ⋅) 's are from the modified MDP.
Proof We prove this result by induction on t; the statement is trivially true for t = T since in that case everything is zero, so we focus on what happens for a generic t < T, knowing that L � u t+1 (s, L � ) = U t+1 (s) for all s. For the fixed policy , we define p t,s ∶= ℙ[V ≥ t (s, ), D ≥ s|L = ] . Then, Note that in the second equality we just expanded the u t (s, ) term conditioning on the transition at time t, while the following equality follows from the inductive hypothesis. The last two inequalities then follow from the definitions in Eqs. (1) and (2). ◻ This lemma, however, does not suffice on its own, as agents may behave strategically by overreporting their length, if the prices are not increasing. This would alter the transition probabilities, breaking the analysis. In Sect. 3.5 it is proved that, under some natural assumption on the probability distribution, this can not happen: the optimal policy for nonstrategic agents is monotone, and therefore truthful.

Infinite time horizon
Algorithm 2 does not allow us to immediately compute a solution for the infinite discounted horizon case. However, we can exploit the discounting factor on the revenues to obtain an approximation of the infinite optimum: it suffices to consider the truncated problem up to a certain sufficiently large T and solve it optimally using the algorithm presented above. Formally, we have the following Lemma. Proof Note that in order to compute policy it is straightforward to add the discount factor to Algorithm 2. Let * be the Bayes-optimal infinite-horizon strategy -which is known to be time-independent -and let be as in the statement (where we set t (s, ) = ∞ for all t > T ). Then, in expectation over time 0 through T, pricing as yields greater revenue than following * . Conversely, in expectation over all time, pricing as * yields greater revenue than . However, after time T, the maximum possible revenue due to any policy is

Page 11 of 25 11
And so the difference in revenue due to following or * is at most , since T is sufficiently large.
It remains to show that ̄ performs better than overall. Let i be the policy which agrees with 0 for all t ≤ i , then equals t−i for t > i . Observe that, 1 is optimal in expectation over the interval [1, T + 1] , and is equivalent to = 0 for the first step. Therefore, 1 performs better than . Similarly, we can argue i+1 performs better than i over the interval [i, T + i] and equally before, hence performs better overall.
Thus, we have a sequence of policies = 0 , 1 , 2 , … converging to ̄ , and whose expected revenue is monotone nondecreasing along the sequence. Therefore, the expected revenue due to ̄ is greater than that of , which is an additive-approximation to the optimal policy. ◻ Therefore, we have reduced the infinite discounted horizon problem to the finite one. The discount factor can be easily inserted in all proofs of the paper where needed without affecting the results. We remark that this truncation procedure is analogous to the classical value iteration technique [33].

Approximation algorithm for continuously supported values
Similarly to what we have done in the previous section, we analyse how to generalize Algorithm 2. Note that it assumes that the value of the jobs (V) is discretely supported, and the running time depends on |V| . In this section, we analyze the error incurred by discretizing the space of possible values and then computing the optimal policy.
Let > 0 be some desired small grid size, and suppose we only allow ourselves to set prices which are multiples of . We claim that this incurs a small loss to the total revenue. It implies that the results for the finite and infinite discounted problem can be applied also in this case, paying a small additive error term.
Recall that p s ( ) ∶= ℙ[V ≥ , D ≥ s|L = ] , U * t (s) = L u * t (s, L) , and Similarly, we can define U * t, (s) and u * t, (s, ) , restricting the maximum to choosing from multiples of . In the following we use ⋅ ℤ to refer at the grid of integer multiples of .

Lemma 3 The following inequality holds for all s and t:
Proof We show this Lemma by induction on the value of t, decreasing. To simplify the notation, define for all t.
For t = T + 1 the claimed inequality follows trivially, since T+1 = 0 . We are left with bounding inductively the value of t . By the usual trick of conditioning with respect to the outcome of the transition at time t and some algebraic manipulation, we get that Now, let * be the optimizer of this right hand side over ℝ (where the value would attain u * t (s, ) ), and ̂ be * rounded down to the nearest multiple of . Then, since p s (⋅) is nonincreasing, Thus combining equations (6) and (7), we get From which we conclude, by taking the expectation over and using the inductive assumption, that t ≤ (T − t) , as desired. ◻ Corollary 1 Let U * (⋅) and U * ∞, (⋅) be defined as above, but for the infinite horizon discounted, then |U * (s) − U * ∞, (s)| ≤ ∕(1 − ) ∀s.
Proof As shown in the previous section, it suffices to perform the analysis in the finite horizon, while taking the discount factor into account, then take the limit as T → ∞ . The same calculations as above gives Summing the 's and taking T → ∞ , we get u * ∞, (s, ) ≥ u * (s, ) − ∕(1 − ) as desired. ◻

Monotonicity of the optimal pricing policies
Recall that the solution of the more efficient MDP formulation is only correct if we show that it is always monotone without considering the strategic behaviour of agents, ensuring incentive compatibility of the optimum. An optimal monotone strategy cannot be obtained for all distributions on L, V, and D. As an example, for any distribution where a job's value is a deterministic function of their length, the optimal policy is to price discriminate by length. If this function is not monotone, the optimum won't be either. To this end, we introduce the following assumption, which we will discuss below, and which will imply monotonicity of the pricing policy.

Assumption 1 The quantity ℙ[V≥ � ,D≥s|L= ]
ℙ[V≥ ,D≥s|L= ] is monotone non-decreasing as grows, for any state s and 0 ≤ < ′ fixed. This is not a natural, or immediately intuitive assumption. However, we will show that it is satisfied if the valuation of jobs follows a log-concave distribution which is parametrized by the job's length, and where the valuation is (informally) positively correlated with this length. Log-concave distributions are also commonly referred to as distributions possessing a monotone hazard rate, and it is common practice in economic settings to require this property of the agent valuations.

Lemma 4 Let, V s denote the marginal r.v. V conditioned on L = and D ≥ s . Let Z be a continuously-supported random variable, and s
A discussion of log-concave random variables and a proof of this fact is given in "Appendix". Many standard (discrete) distributions are (discrete) log-concave random variables, including uniform, Gaussian, logistic, exponential, Poisson, binomial, etc. These can be proved to be log-concave from the discussion in "Appendix". In the above, the terms represent a notion of spread or shifting, parametrized by the length, indicating some amount of positive correlation.
It remains to show the price monotonicity under the above assumption. First, we begin with the following, which holds for arbitrary distributions.

s) is monotone non-increasing in s for any t fixed.
Proof The proof is by induction on decreasing time. At time t = T , there is no future revenue and U * T (s) = 0 , so the inductive claim follows trivially. Suppose now that the inductive claim holds at time t + 1 . It suffices to show that this holds for each u * t (s, ) , since U * t (s) is simply their expectation. Let * t be the optimal pricing policy computed for the time t by the Algorithm 2. Since the function ↦ ℙ[V ≥ and E] , for any event E , is left-continuous in the variable , we may define, for every ∈ L and s ∈ S, where (x) + ∶= max{x, 0} . The first inequality holds by the induction hypothesis, the second is by definition of (⋅) + , the third by the definition of ′ s , and in the last, from the fact that ′ s is a (possibly) suboptimal pricing policy for the state s at time t. Note that this last inequality requires that the 0 value be feasible in the max, which it is, by setting ′ arbitrarily large. ◻ This lemma ensures that overselling time on the server can only hurt the mechanism. This allows us to conclude.

Lemma 6 If the distribution on job parameters satisfies Assumption 1, then for all
, fix s, t, and , and let 0 be equal to the optimal price * t (s, ) . Observe that 0 maximizes the expression For simplicity, let ∶= U * t+1 (s + − 1) − U * t+1 (s − 1) , and so for any ≠ 0 , Note that, as discussed in the proof of the previous lemma, 0 + ≥ 0 , as otherwise it would be beneficial to set * t (s, ) ← ∞ . The above inequality is then equivalent to We wish to show that, if ≤ 0 , then as increases, the above inequality still holds. This would imply that the price 0 =∶ * 9 (s, ) gives better return than for jobs of length + 1 , implying that the optimal price must be at least * t (s, ) , which is our desired goal. Now, by assumption 1, the left-hand side is non-decreasing in , so it remains to show that the right-hand-side is non-increasing in . The only changing term is , which by Lemma 5, is non-increasing in . Since it is in the denominator of a subtracted, non-negative term, we have our desired result. ◻ So, putting together Lemma 6 with the work done in the previous sections, we have the following theorem.

Theorem 1
The online server pricing problem admits an optimal monotone pricing strategy when the variables L, V, and D satisfy Assumption 1. In addition,

Concentration bounds on revenue for online scheduling
In this section, we show that the revenue of arbitrary policies concentrates around their mean. In particular it holds true for the optimal or approximately optimal strategies described above. This will also allow us to argue later that, if we have an estimate Q of Q, then execute Algorithm 2 given the distribution Q , then the output policy will perform well with respect to Q, both in expectation, and with high probability. To show this concentration, we consider the Doob or exposure martingale of the cumulative revenue function introduced in Sect. 2. Define where the X i 's are jobs in the sequence X and the expected value is taken with respect to X i+1 , … X T . Thus, R 0 is the expected cumulative revenue, and R T is the random cumulative revenue. To formally describe this martingale sequence, we introduce and formalize some previous notations. Recall that X 1 , X 2 , … is a sequence of jobs sampled i.i.d. from an underlying distribution Q. Fix a pricing policy ∶ [T] × S × L → ℝ . Note that the state at time t is a random variable depending on both the (deterministic) pricing policy and the (random) X 1 , … , X t−1 . We denote it S t ( , X) , or S t for short. Formally, sup- and otherwise S t+1 ( , X) = S t ( , X) + L t − 1 . Furthermore, let t ( , X) be equal to 0 in the first case above (the t-th job is not scheduled), and t (S t , L t ) otherwise. Thus, S t ( , X) and t ( , X) are functions of the random values X 1 , … , X t for fixed. Note that t implicitly depends on S t . Let X >i ∶= (X i+1 , X i+2 , …) and X ≤i ∶= (X 1 , … X i ) . Recalling that We wish to show that (X, ) concentrates around its mean. Since R 0 is the expected revenue due to , and R T is the (random) revenue observed, it suffices to show |R 0 − R T | is small, which we will do by applying Azuma-Hoeffding inequality (as in, e.g., Theorem 13.4 of [27]) after showing the bounded-differences property.
Theorem 2 Let X be a finite sequence of T jobs sampled i.i.d. from Q, and let be any monotone policy. Then, with probability 1 − , in the finite horizon, while in the infinite horizon discounted, In particular, these results hold true for the (approximately) optimal pricing strategies of Theorem 1.
Proof For the finite horizon, we apply Azuma-Hoeffding inequality to the martingale R t . We begin by showing the bounded differences property. Note that we do not require truthful behaviour from the jobs, since taking strategic behaviour into account for a nonmonotone policy is equivalent to modifying the distribution over the jobs and making the distribution state-dependent, by increasing the length of those jobs who would rather buy a longer interval. Thus, where the equalities follow by definition and the properties of conditional expectations, while the inequality on the bound on the values. With this property, we can apply Azuma-Hoeffding inequality and get

Robustness of pricing to approximate distributional knowledge
In this section, we show that results analogous to Theorems 1 and 2 may be obtained even in the case in which we do not have full knowledge of the distribution Q, but only an estimate Q . We then show how to obtain a valid Q from samples.

Robustness of the pricing strategy
Let's suppose that instead of knowing the exact distribution Q = (D, L, V) of the jobs, we have only access to some estimate Q = (D,L,V) with the following property, for some > 0 : ∀s ∈ S, ∈ L and v ∈ V it holds that For the sake of brevity, we abuse notation and denote the condition in (10) as |Q −Q| < .
Later, we will need to estimate the value ℙ[L = , ¬(V ≥ v, D ≥ s)] , given Q , that is the probability that the job has length , but either cannot afford price v, or cannot be scheduled s slots in the future. This is equal to The left-hand term is equal to ℙ[L = ,V ≥ 0,D ≥ 0] , and so we have access to both terms. The estimation error is additive, so the deviation is at most 2 .
Denote p t,s ∶= ℙ[V ≥ t (s, ), D ≥ s|L = ] , and recall that U t (s) is defined as the expected revenue from time t onwards, conditioning on S t = s , in formula Let Û t (⋅) be the same as U t (⋅) , but where the variables are distributed as Q . As before, let U *

Learning the underlying distribution from samples
As discussed above, we show here how to compute a Q from samples of Q, such that |Q −Q| is small with high probability. In particular, we present a sampling procedure which respects the rules of the pricing server mechanism. When a job arrives, we only learn its length, and only if it agrees to be scheduled. Thus, we are not given full samples of Q, complicating the learning procedure. Thanks to the previous section, we know that a policy which is optimal with respect to Q will be close-to-optimal with respect to Q.
We remark, however, that the power of the results of the previous section is not exhausted by this application: one may apply directly the robustness results to specific problems in which the Q is subject to (small) noise or an approximate distribution is already known from other sources.
Let  (14), the sample-average of each value have error at most with probability 1 − , for any one choice of ( , v, s).
Repeating this process for all ≤ 2 choices of v ∈ V and s ∈ S gives us estimates for each. Now, if we want to have the estimate hold over all choices of , v, s , it suffices to take the union bound over all ≤ 3 values (incl. ), and scaling accordingly. If we take n ≥ 3 log(2 ∕ )∕(2 2 ) samples for each of the ≤ 2 choices of v and s, then simultaneously for all , v, and s, the quantity in (14) is at most . Therefore, we have obtained the " |Q −Q| < " condition. It should be noted that, for this sampling procedure, if a job of length is scheduled, we must possibly wait at most times units before taking the next sample to clear the buffer. This blows up the sampling time by a factor of O( ) . From Lemma 7 and Hoeffding bound (as in Theorem 4.12 of [27]) we get the following result.

Performance of the computed policy
We use here the result of the previous sections to analyze the performance of the policy output by Algorithm 2 after the learning procedure. By the estimation of revenue, the best policy in estimated-expectation is near-optimal in expectation. Since revenues from arbitrary policies concentrate, we get near-optimal revenue in hindsight.
Formally, for > 0 , Lemma 8 gives us that if the sample-distribution Q is computed on n ≥ 6T 4 log(2 ∕ )∕ 2 samples, then with probability 1 − over the samples, |U * t (s) −Û * t (s)| ≤ . Note that U * t=0 (s = 0) is exactly the expected cumulative revenue of the optimal policy. For clarity of notation, denote We have shown that for sufficient samples, | T ( * |Q) − T ( * |Q)| < , with probability 1 − . This observation allows us to conclude and ̂ . Furthermore, by Lemma 8, | T ( |Q) − T ( |Q)| < ∕2 with probability 1 − ∕4 , for both =̂ and * . This is because from the point of view of ̂ , Q is the true distribution, and Q is the estimate. Taking the union bound over all four events above, and recalling that ̂ maximizes T ( |Q) , and * maximizes T ( |Q) , we get the following with probability 1 − : as desired.
When V is continuously distributed, choose prices which are multiples of between 0 and , as is outlined in Sect. 3.4. ◻ For what concerns the -discounted infinite horizon case, we have the following ln (1− ) + n a monotone policy ̂ such that for any , with probability 1 − , As above, this policy ̂ is computed by learning Q from n samples as in Section 4.2, then running the modified Algorithm 2 for the estimated distribution as in Sect. 3.3. In case V is continuously distributed, we restrict ourselves to prices which are multiples of between 0 and . We recall that all these results need the distribution assumption from Sect. 3.5.

Conclusions and future work
In this paper we studied the problem of pricing computing time on a single server when i.i.d. jobs arrive online with private types. The type of a job specifies its length, willingness to pay in order to get allocated and a hard deadline to get completed. We showed how the problem can be cast in the Markov Decision Process framework and how a non-trivial transformation of the state space makes the underlying problem computationally tractable while retaining incentive compatibility. Finally, we started the investigation of the learnability of the pricing problem, showing that polynomially many samples are enough to achieve a good approximation of the optimal pricing strategy.
Our model is simple but rich enough to capture many interesting features: strategic behaviour (e.g., the jobs might misreport their type), congestion (e.g., there is a carry-over effect in the server given by the queue of allocated jobs), and partial feedback (e.g., only partial information about the type is revealed to the mechanism). While the applicability of the model per se might appear limited, we believe that these features, as well as the techniques used, will foster future research on the subject. To conclude, we present some possible directions and their challenges.
Multiple servers or jobs The first natural extension to our model consists in considering multiple servers and multiple jobs arriving at each time step. The main challenge given by this problem is the high dimensionality of the state space (at least a number for each server describing its availability) and, possibly, of the action space (different price menus for each server). A possible way to overcome these difficulties might be to consider some heuristic to match supply with demand and then evaluate its approximation with respect to the optimal pricing scheme. Notice, moreover, the extra layer of complexity given by how to maintain truthfulness also in the job-server matching.
Different congestion models In our model we consider only greedy allocation; i.e., a job arrives and has to be immediately scheduled starting from the first available slot. This enforces the desirable property for the job to know immediately whether it gets allocated or not and when. This is important also in the application: often it is crucial to receive a quick, precise and definitive answer. A possible direction of research is to study different, more complex, allocation rules as, for example, in [1], where the job is not told immediately if it is accepted but only until a certain distance from the deadline. From a technical point of view, the main difficulty inherent in this approach is the increasing complexity of the MDP state space. Finally, we mention that a further generalization of our model, with interesting applications, might be to also include the waiting time suffered by the job in the pricing decision, and not only its deadline.
Online learning The bounds on the sample complexity contained in Sects. 4.2 and 4.3, although polynomial in the input, are impractical for real-life application. As already mentioned, this is mainly due to the specific structure of the feedback received by the mechanism, that is strictly weaker than the classical full feedback [7,26]: the mechanism observes only the price (if any) chosen by the job in the proposed price menu, not the actual type of the job. An interesting direction of research is the investigation of the exploration-exploitation trade-offs of the problem in the regret minimization framework, where a natural benchmark to compare with is the best fixed price menu. Apart from the difficulty given by the feedback model, other challenges are offered by the combinatorial complexity of optimizing price menus (instead of single prices as in [7,26]) and the carry-over effect given by the queue of allocated jobs (e.g., [3,17]).

Appendix: Log-concave distributions
In Sect. 3.5, we sought to show that if the value of a random job has a log-concave distribution, then the optimal policy will be monotone. We present here a discussion of logconcavity, both for continuous and discrete random variables, and give the proof of the monotonicity of the prices.
Formally, a function f ∶ ℝ → ℝ is log-concave if for any x and y, and for any 0 ≤ ≤ 1 , lg f ( x + (1 − )y) ≥ lg f (x) + (1 − ) lg f (y) . Equivalently, f ( x + (1 − )y) ≥ f (x) f (y) 1− . For a discretely supported f ∶ ℤ → ℝ , we replace this condition with f (x) 2 ≥ f (x − 1)f (x + 1) , emulating the continuous definition with = 1 2 . We further require that the support of f be "connected". Definition 1 A continuous random variable X with density function f is said to be logconcave if f is log-concave. A discrete random variable Y with probability mass function p is said to be log-concave if p is discretely log-concave.
A well-known fact is that log-concave random variables also have log-concave cumulative density/mass functions. We present here a quick proof of this fact, for completeness. Proof The continuous case is well-documented in the literature. See, for example [4]. For the discrete case, observe first that since the mass function is non-negative, and we have assumed contiguous support, the function must be single-peaked, i.e., quasi-concave, as any local minimum would contradict the definition. Furthermore, the definition of log-concavity is equivalent to  Proof Let P ∶ ℤ → [0, 1] be the right-hand cumulative mass function for Y. Then, it suffices to have ℙ[Z ≥ n] = P(n) for all integers n. Let ∶ ℝ → ℝ be the piecewise-linear function such that (−∞) → 0 , (∞) → −∞ , and (n) = log(P(n)) for all n. Since log(P) is a discretely concave and non-increasing function, must be concave and nonincreasing. We can then set Z to be the random variable whose density is given by − d dx exp( (x)) . ◻