Does Hashem benefit from mankind doing the commandments of the Torah?
The Ramban states in Devorim (Perek Kof Beis, Pasuk Vov) that "there is no benefit in our keeping of mitzvos to the Holy One blessed be He." One cannot "benefit Him" or "harm Him" through the keeping or not keeping of mitzvos. He states further that our "words of praise and remembrances of his miracles are considered as nothingness and emptiness to him. All these [mitzvos] are for our benefit alone. This is something agreed upon by all our Rabbis."
Rambam states in the Moreh Nevuchim, Book I, Chapter 55 that no change or emotion can ever be predicated of Hashem. As the Novie states in Malachi Perek Gimmel, Pasuk Vov, "I, G-d, do not change." Rambam states in the Yad, Laws Concerning the Fundamentals of our Faith, Perek Alef, Halacha Yud Alef, "and He does not change, for there is nothing that can cause change in him. There does not exist in him... anger or laughter, happiness or sadness…" It is certainly clear from the Rambam and Ramban that we cannot say of the Creator that he is at one time sad, and at another happy. He, being perfect, does not change ever. We cannot effect him or change him no matter what we do, whether we are righteous or evil, whether we pray or don't pray.
Based on the above two Rishonim, it would seem that we cannot in any way benefit or change God with the performance of the commandments in the Torah.
The Baal Hatanya explains in Torah Ohr (נה,ד) that
ישראל מפרנסין לאביהם שבשמים
Israel are providers to their father in heaven.
Which he brings from The Midrash Rabbah Shir Hashirim 1:9:
רעיתי מהו רעיתי אמר רבי יונתן מפרנסתי הן
What does "My Beloved" mean? Rabbi Yonasan says they are my provider.
According to chassidus, this is an analogy to understand the benefit so to speak that Hashem gets from our divine service. Although on one hand Hashem does not lack anything, He has made it His ultimate will to have a dwelling place in the lower worlds (Dira B'Tachtonim), and it is His will that this be achieved through the work of a Jew. When a Jew serves Hashem in the proper way he provides this dwelling place for Hashem in the world. So in this way Hashem so to speak benefits from Jews doing mitzvos.
No. G-d gets nothing from a person doing good: "If you sin, how will you affect Him? And if your sins multiplied, what will you have done to Him? If you have been righteous, what can you give Him, or what will He accept from your hand?" (Iyov 35:6-7).
If so, why do we serve G-d?
From Rav Schwab on Prayer (by Rabbi Shim'on Schwab), pp. 416-417:
Since we are at a loss to adequately express our gratitude to HaKadosh Baruch Hu, we declare וקונה הכל, meaning, "We have nothing to offer You, for You own everything; we are therefore Your servants."
There is an interesting illustration of this in Parashas Vayigash (Bereishis 47:13-23) in the narrative of how Yosef managed the distribution of the stored grain and food in Egypt during the famine. The Torah tells us there that in the first year of the famine alone, the Egyptians and Canaanites used all of their money and traded all of their livestock to buy enough grain and food to sustain themselves. And in the second year, with no wherewithal to buy food, the populace approached Yosef and offered to exchange themselves, together with their land, to Pharaoh for food. This offer was accepted by Yosef on behalf of Pharaoh. The result was that, in exchange for feeding the Egyptian population, Pharaoh acquired all their money, livestock, land, and even their bodies as indentured slaves, in exchange for their sustenance.
The reason the Torah relates this piece of Egyptian history — which, on the surface, has no connection with the development of the Jewish people in Egypt — is to illustrate for us how we are to approach the concept of gratitude to HaKadosh Baruch Hu when we are utterly devoid of the means to do so. Just as the Egyptians of old declared, ונהיה ... עבדים לפרעה, and we will become slaves to Pharaoh (Bereishis 47:19), when they lacked any other means of repayment for their sustenance, we too say to HaKadosh Baruch Hu, we offer ourselves as Your servants: וקונה הכל, "You own everything — even ourselves."
See also this which basically reinforces the concept: The commandments are not for G-d; they are for us to improve ourselves.