  This paper studies a discrete model of a large dam where the difference
between lower and upper levels, $L$, is assumed to be large. Passage across the
levels leads to damage, and the damage costs of crossing the lower or upper
level are proportional to the large parameter $L$. Input stream of water is
described by compound Poisson process, and the water cost depends upon current
level of water in the dam. The aim of the paper is to choose the parameters of
output stream (specifically defined in the paper) minimizing the long-run
expenses that include the damage costs and water costs. The present paper
addresses the important question \emph{How does the structure of water costs
affect the optimal solution?} We prove the existence and uniqueness of a
solution. A special attention is attracted to the case of linear structure of
the costs.
  As well, the paper contributes to the theory of state-dependent queueing
systems. The inter-relations between important characteristics of a
state-dependent queueing system are established, and their asymptotic analysis
that involves analytic techniques of Tauberian theory and heavy traffic
approximations is provided.
