النتائج 1 إلى 5 من 5

الموضوع: طريقــة تسريــع قاعدة البيانات

  1. #1
    عضو نشيط جدا
    تاريخ التسجيل
    Jul 2001
    المشاركات
    311

    طريقــة تسريــع قاعدة البيانات



    هذه طريقــة لتسريـــع عمل قاعدة البيانات في المنتدى
    باستخدام برنامج المفكره او اي برنامج للتعامل مع النصوص عدل في الملف التالي config.php الوجود في مجلد (vb\admin) اسم قاعدة البياتات واسم المستخدم لها وكلمة السر

    وكذلك لاتنس التعديل التالي فهو مهم جدا لزيادة سرعة قاعدة البيانات من الرقم 1 الى صفر

    // use persistant connections to the database

    // 0 = don't use

    // 1 = use

    الى الرقم صفر


    تحياتي






    __________________
    استغفر الله
    M.Fahad غير متواجد حالياً


  2. #2

    UP



    يرجى التعليق

    هل هذه الطريقة جيدة وليس فيها خطر

    على القاعدة



    تحياتي





    MaKMaN غير متواجد حالياً

  3. #3
    عضو نشيط جدا
    تاريخ التسجيل
    Jul 2001
    المشاركات
    311


    شكراً لك اخوي على هالرد .

    انا من سويتها صار المنتدى طلقــة .





    __________________
    استغفر الله
    M.Fahad غير متواجد حالياً

  4. #4
    عضو نشيط جدا
    تاريخ التسجيل
    May 2002
    المشاركات
    354


    بما أنني أعترف بأنني سيء في الشرح وكذلك الترجمة فعسى أن أجدك فيكم من يقوم بالعمل بدلاً مني:


    Persistent connections are SQL links that do not close when the execution of your script ends. When a persistent connection is requested, PHP checks if there's already an identical persistent connection (that remained open from earlier) - and if it exists, it uses it. If it does not exist, it creates the link. An 'identical' connection is a connection that was opened to the same host, with the same username and the same password (where applicable).

    People who aren't thoroughly familiar with the way web servers work and distribute the load may mistake persistent connects for what they're not. In particular, they do not give you an ability to open 'user sessions' on the same SQL link, they do not give you an ability to build up a transaction efficently, and they don't do a whole lot of other things. In fact, to be extremely clear about the subject, persistent connections don't give you any functionality that wasn't possible with their non-persistent brothers.

    Why?

    This has to do with the way web servers work. There are three ways in which your web server can utilize PHP to generate web pages.

    The first method is to use PHP as a CGI "wrapper". When run this way, an instance of the PHP interpreter is created and destroyed for every page request (for a PHP page) to your web server. Because it is destroyed after every request, any resources that it acquires (such as a link to an SQL database server) are closed when it is destroyed. In this case, you do not gain anything from trying to use persistent connections -- they simply don't persist.

    The second, and most popular, method is to run PHP as a module in a multiprocess web server, which currently only includes Apache. A multiprocess server typically has one process (the parent) which coordinates a set of processes (its children) who actually do the work of serving up web pages. When each request comes in from a a client, it is handed off to one of the children that is not already serving another client. This means that when the same client makes a second request to the server, it may be serviced by a different child process than the first time. What a persistent connection does for you in this case it make it so each child process only needs to connect to your SQL server the first time that it serves a page that makes us of such a connection. When another page then requires a connection to the SQL server, it can reuse the connection that child established earlier.

    The last method is to use PHP as a plug-in for a multithreaded web server. Currently this is only theoretical -- PHP does not yet work as a plug-in for any multithreaded web servers. Work is progressing on support for ISAPI, WSAPI, and NSAPI (on Windows), which will all allow PHP to be used as a plug-in on multithreaded servers like Netscape FastTrack, Microsoft's Internet Information Server (IIS), and O'Reilly's WebSite Pro. When this happens, the behavior will be essentially the same as for the multiprocess model described before.

    If persistent connections don't have any added functionality, what are they good for?

    The answer here is extremely simple -- efficiency. Persistent connections are good if the overhead to create a link to your SQL server is high. Whether or not this overhead is really high depends on many factors. Like, what kind of database it is, whether or not it sits on the same computer on which your web server sits, how loaded the machine the SQL server sits on is and so forth. The bottom line is that if that connection overhead is high, persistent connections help you considerably. They cause the child process to simply connect only once for its entire lifespan, instead of every time it processes a page that requires connecting to the SQL server. This means that for every child that opened a persistent connection will have its own open persistent connection to the server. For example, if you had 20 different child processes that ran a script that made a persistent connection to your SQL server, you'd have 20 different connections to the SQL server, one from each child.

    Note, however, that this can have some drawbacks if you are using a database with connection limits that are exceeded by persistant child connections. If your database has a limit of 16 simultaneous connections, and in the course of a busy server session, 17 child threads attempt to connect, one will not be able to. If there are bugs in your scripts which do not allow the connections to shut down (such as infinite loops), a database with only 32 connections may be rapidly swamped. Check your database documentation for information on handling abandoned or idle connections.

    An important summary. Persistent connections were designed to have one-to-one mapping to regular connections. That means that you should always be able to replace persistent connections with non-persistent connections, and it won't change the way your script behaves. It may (and probably will) change the efficiency of the script, but not its behavior!



    محمــد





    dustyksa غير متواجد حالياً

  5. #5
    عضو نشيط
    تاريخ التسجيل
    Mar 2002
    المشاركات
    237


    شكرآ لك اخي

    والله انا مااعرف اجربها لاني جديد مره
    ولكن راح احاول

    اخي محمد تفضل الترجمه

    ____________________________________________________________________________


    العلاقات المستمرّة هي رابطات إس كيو إل التي لا تنغلق متى إعدام نهايات سيناريوك . عندما تُطْلَب وصلة مستمرّة , بي إتش بي يفحص إذا بالفعل هناك علاقة مستمرّة متماثلة ( الّذي بقي مفتوحةً من أكثر تبكيرًا ) - و إذا تواجد يستخدمه . إذا لا يتواجد يخلق الرّابطة . العلاقة المتماثلة العلاقة التي فُتِحَتْ إلى نفس المضيف , مع/ب نفس الاسم المستخدم و نفس كلمة السّرّ ( أين ساري المفعول ) .

    النّاس الغير معتادون على عمل خدم ويب الطريقة بدقّة و يوزّع الحمل قد يخطئ مستمرّ يوصّل لماذا هم ليسوا . بوجه خاصّ , لا يعطوك قدرة لبدء جلسات المستخدم على نفس رابطة إس كيو إل , لا يعطوك قدرة لمدح إفيسينتلي صفقة , و لا يعملوا قرعة بالكامل للأشياء الأخرى . في الحقيقة , ليكون واضح جدًّا عن العلاقات المستمرّة الخاضعة لا يعطيك أيّ فاعليّة التي كانت غير ممكنة مع إخوتهم الغير مستمرّين .

    لماذا ؟

    هذا يرتبط بعمل خدم ويب الطريقة . هناك ثلاثة طرق التي يمكن أن يستغلّ خادم ويبك بي إتش بي فيها لتوليد صفحات الإنترنت .

    الطّريقة الأولى ستستخدم بي إتش بي كغلاف سي جي آي . متى جرى هذه الطّريقة , مثال لمترجم بي إتش بي خُلِقَ و دمّر لكلّ طلب خادم ( لخادم بي إتش بي ) إلى خادم ويبك . لأنه يُدَمَّر بعد كلّ طلب , أيّ موارد التي يحصلها ( مثل رابطة إلى خادم قاعدة بيانات إس كيو إل ) أُغْلِقَتْ عندما يُدَمَّر . في هذه الحالة , لا تكسب أي شيئ من محاولة أن يستخدم الوصلات المستمرّة - - لا يستمرّوا ببساطة .

    الثّانية , و الأكثر شعبيّة , الطّريقة ستجري بي إتش بي كمركبة في خادم ويب مالتيبروسيس الذي حاليًّا فقط يتضمّن أباتشي . لدى خادم المالتيبروسيس نموذجيًّا عمليّة واحدة ( الوالد ) التي تنسّق مجموعة من العمليّات ( أطفالها ) التي تعمل العمل في الحقيقة للتّقديم أعلى صفحات الإنترنت . عندما يجيء كلّ طلب من عميل , هو يُنَاوَل إلى أحد الأطفال أنّ ليس بالفعل خدمة عميل آخر . هذه الوسيلة ذلك عندما يجعل نفس العميل ثانية تطلب إلى الخادم , أنه قد يُفْحَص بعمليّة طفل مختلفة من المرّة الأولى . ماذا علاقة مستمرّة تكفيك في هذه الحالة يجعله للواحد عمليّة طفل جدًّا فقط يحتاج أن يوصّل إلى خادم إس كيو إل المرّة الأولى أنه يقدّم الخادم الذي يعملنا لمثل هذه العلاقة . متى صفحة أخرى ثمّ يتطلّب علاقة إلى خادم إس كيو إل , يمكن أن يعيد استخدام الوصلة ذلك الطّفل مستخدم أكثر تبكيرًا .

    الطّريقة الأخيرة ستستخدم بي إتش بي ككبس لخادم ويب مالتيثريديد . حاليًّا هذا فقط نظريّ - - بي إتش بي لا بعد يعمل ككبس لأيّ خدم ويب المالتيثريديد . يتقدّم العمل على المساندة لإيسابي , وسابي و نسابي ( على النّافذات ) , الذي/التي سوف الكلّ يسمح بي إتش بي ليُسْتَخْدَم ككبس على خدم مالتيثريديد يحبّ نيتسكيب سريع التّرقّي , خادم معلومات إنترنت مايكروسوفت ( آي آي إس ) , و أو'رييل هو محترف الموقع . عندما يحدث هذا , سيكون السّلوك أساسًا المثل لنموذج المالتيبروسيس الموصوف فيما مضى .

    إذا ليس لدى علاقات مستمرّة أيّ فاعليّة إضافيّة , ماذا هم جيّد ل؟

    الإجابة هنا بسيطة جدًّا - - الفاعليّة . العلاقات المستمرّات جيّدات إذا النّفقات لخلق رابطة إلى خادم إس كيو إل عالي . سواء أو ليس هذه النّفقات عالية فعلاً يعتمد على عوامل كثيرة . حبّ , أيّ نوع قاعدة البيانات هو , سواء أو ليس يجلس على نفس الكمبيوتر الذي يجلس خادم ويبك عليه , كيف محمّل الماكينة خادم إس كيو إل يجلس على وما إلى ذلك . النّتيجة هي ذلك إذا تلك العلاقة مرتفعًا علاقات مستمرّة عالية تساعدك إلى حدّ بعيد . يسبّبون لعمليّة الطّفل أن ببساطة توصّل فقط مرّة لمتوسّط عمرها بالكامل , بدلاً من كلّما يعالج الصّفحة التي تتطلّب التّوصيل إلى خادم إس كيو إل . هذه الوسيلة سوف يكون لدى ذلك لكلّ طفل الذي فتح علاقة مستمرّة علاقته المستمرّة المفتوحة الخاصّة إلى الخادم . على سبيل المثال , إذا كان لدى 20 عمليّات الطّفل المختلفة التي جرت سيناريو التي عملت علاقة مستمرّة إلى خادم إس كيو إل , سوف يكون لدى 20 علاقة مختلفة إلى خادم إس كيو إل , واحد من كلّ طفل .

    لكن لاحظ أن يمكن أن يكون لدى هذا بعض العيوب إذا تستخدم قاعدة بيانات مع/ب حدود العلاقة التي تُتَجَاوَز بعلاقات طفل البيرسيستانت . إذا لدى قاعدة بيانات حدّ ل16 علاقة متزامنة , و في أثناء فصل دراسيّ خادم مزدحم , 17 خيوط طفل تحاول أن توصّل , لن يكون واحد قادر إلى . إذا هناك بقّ في سيناريوهاتك التي لا تسمح للعلاقات أن تنغلق ( مثل عقد هائلة ) , قاعدة بيانات مع فقط 32 علاقة قد تُغْمَر بسرعة . افحص توثيق قاعدة بيانات للمعلومات على المعالجة علاقات خاملة أو مهجورة .

    ملخّص مهمّ . العلاقات المستمرّة صُمِّمَتْ ليحصلن على اقتران متوافق إلى العلاقات المعتادة . ذلك يعني أنّك يجب أن دائمًا تكون قادر أن تستبدل علاقات مستمرّة بالعلاقات غير مستمرّة , و لن يغيّر الطّريقة سيناريوك يتصرّف . هو قد ( و ربّما ) سيغيّر فاعليّة الإجابة , لكنّ ليس سلوكه !


    سلطان





    __________________
    :)
    Suljum غير متواجد حالياً





ضوابط المشاركة

  • لا تستطيع إضافة مواضيع جديدة
  • لا تستطيع الرد على المواضيع
  • لا تستطيع إرفاق ملفات
  • لا تستطيع تعديل مشاركاتك
  •  

أضف موقعك هنا| اخبار السيارات | حراج | شقق للايجار في الكويت | بيوت للبيع في الكويت | دليل الكويت العقاري | مقروء | شركة كشف تسربات المياه | شركة عزل اسطح بالرياض | عزل فوم بالرياض| عزل اسطح بالرياض | كشف تسربات المياة بالرياض | شركة عزل اسطح بالرياض