Chapter 212 The Nexus Project
Chapter 212 The Nexus Project
At 8:10 a.m., when Eric pushed open the door to Ling Yun's office, Ling Yun was already standing in front of the whiteboard.
Three sheets of printed paper were pasted on the whiteboard. The one on the left was the cover of the project proposal approved by the board yesterday, the one in the middle had a rough hierarchical architecture diagram, and the one on the right was a blank schedule. The whiteboard itself had a few words written on it in black marker: event-driven, asynchronous, and non-blocking.
"Good morning," Eric said, holding a notebook and a Montblanc pen.
"Good morning." Ling Yun didn't turn around, continuing to draw a flowchart on the whiteboard. Arrows and boxes, with straight connecting lines. After finishing the last stroke, he turned around, picked up two bound documents from the table, and handed one to Eric.
The document cover reads: "Project code name Nexus - Technical architecture v0.1".
"Sit down." Ling Yun pointed to the chair opposite the desk.
Eric sat down and opened the file. The first page was the table of contents: Architecture Overview, Core Modules, Performance Metrics, Development Phases, and Team Composition. He quickly flipped to the Architecture Overview, his eyes scanning the charts and graphs.
Ling Yun walked to the whiteboard and tapped the architecture diagram in the middle.
"The board approved it yesterday," he said. "Now it's time to implement it. You're the technical lead."
Eric nodded without looking up, still reading the documents.
"Ask me any questions now," Ling Yun said.
Eric flipped to the performance metrics page and pointed to a line of numbers: "50,000 concurrent connections. How do we simulate this in the test environment?"
"Rent a server room," Lingyun said, "find an ISP to run a dedicated line, and use scripts to simulate the connection. The initial testing can lower the standards, but the final acceptance test must meet them."
"Memory usage," Eric continued, "no more than 10KB per connection. Apache now averages 150KB. A tenfold difference. How did they do that?"
"Connection pooling," Lingyun walked to the whiteboard and drew a simple memory layout in the blank space. "Instead of allocating a complete structure for each connection, we use a shared memory area, with worker processes referencing it through pointers. Event notifications use epoll to avoid frequent context switching."
Eric jotted down a few words in his notebook: connection pool, shared memory, epoll. He looked up: "epoll is specific to Linux. FreeBSD uses kqueue, and Solaris uses /dev/poll. Are we going to do multi-platform support?"
"The project only supports the Starry Sky system," Lingyun said. "We will prioritize our ecosystem, and consider other platforms later."
How much of the kernel needs to be modified?
"Not much." Ling Yun walked back to his desk, took out a stack of printed papers from the drawer, which contained hand-drawn kernel call diagrams. "Mainly in the network stack, optimizing the TCP connection establishment and closing paths to reduce lock contention. There's also the encapsulation of the event notification mechanism to provide a unified API."
Eric took the stack of papers and flipped through them. The diagrams were labeled with function names and parameters, and some parts were circled in red with optimization suggestions written on them. He looked at them for two minutes, then put them down.
"The timeline," he said, "is three months to get a usable version. At this level of complexity, it would require at least fifteen full-time engineers. My team doesn't have that many people available right now."
"A new approach." Ling Yun picked up another document from the table, a list of candidates provided by a headhunting firm. "Mark has already contacted them. Interviews will be scheduled for next Monday, and you will be the lead interviewer."
Eric glanced at the list; it contained about twenty people from Sun, IBM, Netscape, and even one from Microsoft's IIS team. He raised an eyebrow: "Can we poach them?"
"The money is sufficient," Ling Yun said. "This project has the highest priority, and the budget is ample."
Eric closed the file and leaned back. "The project goals are clear. But I'd like to know, why now? Apache can hold on for a while longer. We can wait until the market is more mature before getting involved."
Ling Yun didn't answer immediately. He walked to the window and opened the blinds.
"StarCraft," Ling Yun said, his back to Eric, "Yesterday, the server logs at Xinghuo Internet Cafe showed that Apache crashed three times. At its peak, there were 12,000 people online, and the response latency was over two seconds."
Eric didn't say anything.
"StarTalk Instant Messaging," Lingyun continued, "has surpassed 600,000 users last week. Our backend is built with Apache, and now during peak hours every night, the CPU usage spikes to 90%. Our operations team is called in the middle of the night to restart it."
He turned around, walked back to the whiteboard, and drew a horizontal line under "50,000 concurrent connections" with a red pen.
"The demand isn't a future tense," Lingyun said, "it's an ongoing one. Blizzard is going to talk to us next week about expanding Battle.net, and Yahoo is also asking if their news site can use our solution. The market is waiting, but we don't have a product."
Eric was silent for a few seconds, then nodded: "Understood."
He opened his notebook to a new page and wrote down the date: December 12, 1997. Then he looked up: "I basically agree with the architecture. But there's one technical point I need to confirm—in your 'master process-worker process model,' are the worker processes completely independent?"
"right."
"How is the shared configuration synchronized? If the configuration is modified at runtime, does every worker process have to re-parse it?"
"The main process is responsible for configuration resolution," Lingyun walked back to the whiteboard and drew a simple process relationship diagram next to the architecture diagram. "When the worker processes start, they inherit the configuration from the main process. During hot updates, the main process re-parses the configuration and then notifies the worker processes to gradually restart. The old process finishes processing the existing connections before exiting, and the new process uses the new configuration."
"Graceful reboot".
"right."
"Signaling mechanism?"
"SIGHUP triggers reload, SIGTERM gracefully shuts down, and SIGQUIT quickly shuts down."
Eric quickly took notes. His handwriting was neat, and each technical point was numbered. "Memory management module," he said as he wrote, "requires specialized personnel. The kernel team can't spare any."
"One of the new hires specializes in memory optimization," Lingyun said. "He came from IBM and used to work on database caching layers. You should ask him about that during the interview."
"it is good."
wavenovel