The invention discloses a software system performance modeling and optimization method based on a generating countermeasure network, which mainly solves the problems of high time cost, too much difficulty in training, easy collapse of training network and limited optimization space in the prior art. The implementation scheme is as follows: 1) acquiring the feature sample set of the software system; 2) fixing that hardware environment, configuring the software system, carry out performance testing according to the characteristic sample set, obtaining throughput or time delay, carry out pretreatment on the throughput or time delay, and sequentially carrying out single thermal coding and normalization to obtain structured data; 3) at that start of each iteration, randomly selecting half of the structured data from the step 1 as a training sample, iteratively train the generated antagonism network to obtain an optimized sample; 4) comparing the performance of the training sample and the optimization sample to verify the optimization effect. The invention reduces the time cost, improves the robustness and stability of the network, has obvious optimization effect, and can be used for theprocessing of the Internet and the big data.