Urban and peripheral agriculture (UPA) is one of the critical factors when urban sustainability is taken into consideration. UPA is considered to be possible to threaten the sustainability of cities while it is considered to have great contributions to the sustainable development of cities at the same time. Therefore, it is necessary for UPA to maintain the balance of three factors, i.e. economic efficiency, sociality, and environmental conservation. However, the relative importance of each factor may vary depending on the difference of countries, regions and time. According to Kiminami and Kiminami (2006), the functions of urban agriculture expected by urban residents in advanced countries such as Tokyo of Japan are changing from the function of producing agricultural goods to the others, i.e. the functions of creating landscapes, ensuring land conservation and sustainable management of renewable natural resources and providing environmental benefits, etc. On the other hand, along with the rapid urbanization in developing countries, huge amount people have migrated from rural to urban area. Such kind of situation has caused the problems of environmental pollution, urban poverty and shortage of nutrition in cities on one side, and an enlargement of urban and peripheral agriculture on the other. The contribution of UPA on GDP in developing countries has drawn more and more attention. Amongst Shanghai is one of the most notable cities. In this research, the sustainability of agriculture in Shanghai will be analyzed from the aspects of economic efficiency, sociality and environmental conservation by taking the method of questionnaire survey intended for the residents on urban agriculture. JEL classification: Q10, I31, Q56