Mobile-edge computing (MEC) has been envisioned as a promising paradigm to meet ever-increasing resource demands of mobile users, prolong battery lives of mobile devices, and shorten request response delays experienced by users. An MEC environment consists of many MEC servers and ubiquitous access points interconnected into an edge cloud network. Mobile users can offload their computing-intensive tasks to one or multiple MEC servers for execution to save their batteries. Due to large numbers of MEC servers deployed in MEC, selecting a subset of servers to serve user tasks while satisfying delay requirements of their users is challenging. In this paper, we formulate a novel delay-energy joint optimization problem through jointly considering the CPU-cycle frequency scheduling at mobile devices, server selection to serve user offloading tasks, and task allocations to the selected servers. To this end, we first formulate the problem as a mixed-integer nonlinear programming, due to the hardness to solve this nonlinear programming, we instead then relax the problem into a nonlinear programming problem that can be solved in polynomial time. We also show how to derive a feasible solution to the original problem from the solution of this relaxed solution. We finally conduct experiments to evaluate the performance of the proposed algorithm. Experimental results demonstrate that the proposed algorithm is promising. * W is truncated to a nearest integer W if it is not an integer.